1 Introduction

1.1 Usage of this file

This file serves to be a supplementary document that describes all the statistics results performed for this project. It may help to test some new questions that are not included in the corresponding slides.

1.2 Experiment designs

This file displays the results of the FaceWord project (data collected at NYU). There are two experiments in this project. In Experiment 1, Chinese participants viewed Chinese faces and characters in four conditions (Layout: intact, misconfigured [top and bottom parts were switched], top and bottom) and completed an additional localizer (Chinese faces, Chinese characters, objects, scrambled objects). In Experiment 2, English speakers viewed Chinese characters and English words in four conditions (Layout: intact, misconfigured, top [top parts of Chinese characters; left two letters for English words] and bottom [bottom parts of Chinese characters; right four letters for English words]) and completed an additional localizer (Caucasian faces, English words, objects, scrambled objects).

1.3 Introduction to the analyses included in this file

For the localizer, results of univariate analysis in the right FFA is displayed.

For the main runs, analysis is conducted for each ROI separately (FFA, FFA1, FFA2, VWFA, LOC).
For each ROI, three analyses are performed:

  1. Univariate analysis (Repeated-measures ANOVA) is performed to compare the neural responses (beta values) of different conditions.
    • E1: 2(Chinese faces vs. Chinese Characters) * 4 (intact, misconfigured, top vs. bottom);
    • E2: 2(Chinese characters vs. English words) * 4 (intact, misconfigured, top vs. bottom).
  2. Multivariate pattern analysis (MVPA) with libsvm is used to decode different condition pairs (see below) and one-tail one-sample t-tests is used to test if the pair of conditions can be decoded [whether the accuracy is significantly larger than the chancel level (0.5); one-tail one-sample t-tests].
    • Pairs in E1:
      • face_intact vs. word_intact;
      • face_intact vs. face_miscon;
      • face_top vs. face_bottom;
      • word_intact vs. word_miscon;
      • word_top vs. word_bottom.
    • Pairs in E2:
      • Chinese_intact vs. English_intact;
      • Chinese_intact vs. Chinese_miscon;
      • Chinese_top vs. Chinese_bottom;
      • English_intact vs. English_miscon;
      • English_top vs. English_bottom.
  3. Similarity of top+bottom to intact vs. misconfigured: The dependent variable is the probability of top+bottom was decoded as misconfigured conditions. Two-tail one-sample t-tests is used to test if top+bottom is more similar to misconfigured relative to intact.
    • If the pattern of top+bottom is more similar to that of misconfigued relative to intact, the probability (of being decoded as misconfigued) should be significantly larger than the chance level (0.5).
    • If the pattern of top+bottom is more similar to that of intact relative to misconfigued, the probability (of being decoded as misconfigued) should be significantly smaller than the chance level (0.5).

1.4 How is the probability of top+bottom being decoded as misconfigued calculated?

The probability was estimated for each particiapnt separately:

  1. The patterns of top and bottom are combined with three different weights (0.5/0.5, 0.25/0.75, 0.75/0.25).
  2. Supported Vector Machine (libsvm) is trained with the patterns of intact vs. misconfigued (10 runs).
  3. The trained model is used to predict the probability of the combined patterns being decoded as misconfigured [for each run separately].
  4. The probability of top+bottom being decoded as misconfigued for each participant is calculated by averaging the probability for each run.

2 Preparations

3 Load and clean data

3.1 Data from localizer scans

3.2 Data for univariate analyses

3.3 Data from CoSMoMVPA

3.4 Data for the Similarity of top + bottom

4 ROI information

4.1 Label used for each ROI

The comments (texts after the dash sign) display all the available labels for each ROI.

# Experiment 1
label_lFFA_E1 <- label_lFFA[1] # "roi.lh.f20.f-vs-o.label" "roi.lh.f40.f-vs-o.label"
label_rFFA_E1 <- label_rFFA[1] # "roi.rh.f20.f-vs-o.label" "roi.rh.f40.f-vs-o.label"

label_lFFA1_E1 <- label_lFFA1[1] # "roi.lh.f13.f-vs-o.ffa1.label" "roi.lh.f20.f-vs-o.ffa1.label"
label_rFFA1_E1 <- label_rFFA1[1] # "roi.rh.f13.f-vs-o.ffa1.label"

label_lFFA2_E1 <- label_lFFA2[1] # "roi.lh.f13.f-vs-o.ffa2.label"
label_rFFA2_E1 <- label_rFFA2[1] # "roi.rh.f20.f-vs-o.ffa2.label" "roi.rh.f40.f-vs-o.ffa2.label"

label_VWFA_E1 <- label_lVWFA[1] # "roi.lh.f13.w-vs-o.label"

label_lLOC_E1 <- label_lLOC[1] # "roi.lh.f13.o-vs-scr.label"
label_rLOC_E1 <- label_rLOC[1] # "roi.rh.f13.o-vs-scr.label"

# Experiment 2
label_lFFA_E2 <- label_lFFA[1] # "roi.lh.f20.f-vs-o.label" "roi.lh.f40.f-vs-o.label"
label_rFFA_E2 <- label_rFFA[1] # "roi.rh.f20.f-vs-o.label" "roi.rh.f40.f-vs-o.label"

label_lFFA1_E2 <- label_lFFA1[1] # "roi.lh.f13.f-vs-o.ffa1.label" "roi.lh.f20.f-vs-o.ffa1.label"
label_rFFA1_E2 <- label_rFFA1[1] # "roi.rh.f13.f-vs-o.ffa1.label"

label_lFFA2_E2 <- label_lFFA2[1] # "roi.lh.f13.f-vs-o.ffa2.label"
label_rFFA2_E2 <- label_rFFA2[1] # "roi.rh.f20.f-vs-o.ffa2.label" "roi.rh.f40.f-vs-o.ffa2.label"

label_VWFA_E2 <- label_lVWFA[1] # "roi.lh.f13.w-vs-o.label"

label_lLOC_E2 <- label_lLOC[1] # "roi.lh.f13.o-vs-scr.label"
label_rLOC_E2 <- label_rLOC[1] # "roi.rh.f13.o-vs-scr.label"

ROI <- factor(c("FFA", "FFA1", "FFA2", "VWFA", "LOC"), levels = ROIOrder)
left_E1 <- c(label_lFFA_E1, label_lFFA1_E1, label_lFFA2_E1, label_VWFA_E1, label_lLOC_E1)
right_E1 <- c(label_rFFA_E1, label_rFFA1_E1, label_rFFA2_E1, 'NA', label_rLOC_E1)
left_E2 <- c(label_lFFA_E2, label_lFFA1_E2, label_lFFA2_E2, label_VWFA_E2, label_lLOC_E2)
right_E2 <- c(label_rFFA_E2, label_rFFA1_E2, label_rFFA2_E2, 'NA', label_rLOC_E2)

label_ROI <- tibble("ROI" = ROI, "left_E1" = left_E1, "right_E1"= right_E1, "left_E2" = left_E2, "right_E2" = right_E2)

label_ROI

The above table displays the label used for each ROI and each Experiment in this analysis. (VWFA is only found on the left hemisphere.)

4.2 Size of labels

roi_info %>% 
  select(-nVertices) %>% 
  spread(Label, LabelSize) 

The above table displays the size (in mm2) of each label for each participant. NA denotes there is no that label for that particiapnt.

4.3 Number of vertices for each label

roi_info %>% 
  select(-LabelSize) %>% 
  spread(Label, nVertices) 

The above table displays the number of vertices for each label and each participant. (NA denotes there is no this label for that particiapnt.)

4.4 Number of subjects

df_univar_agg %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) %>% 
  ungroup() %>% 
  filter(Label %in% c(left_E1, right_E1, left_E2, right_E2)) %>% 
  mutate(Hemi = substr(Label, 5,6),
         Hemisphere = if_else(Hemi == "lh", "left", if_else(Hemi == "rh", "right", "NA")),
         Col_name = paste(Hemisphere, paste0("E", ExpCode), sep = "_"),
         ROI = if_else(grepl("ffa1", Label), "FFA1", 
                       if_else(grepl("ffa2", Label), "FFA2", 
                               if_else(grepl("w-vs-o", Label), "VWFA", 
                                       if_else(grepl("o-vs-scr", Label), "LOC",
                                               "FFA")))), 
         ROI = factor(ROI, levels = ROIOrder)) %>% 
  select(ROI, Col_name, Count) %>% 
  spread(Col_name, Count) %>% 
  select(ROI, left_E1, right_E1, everything()) 

The above table dispalys the number of participants included in the following analyses for each ROI. (VWFA is only found on the left hemisphere.)

4.5 Number of subjects excluded

df_mvpa %>%
  filter(nVertices < nVtx_min) %>% # remove the label whose vertex number is smaller than nVtx_min
  select(ExpCode, Label, SubjCode) %>%
  distinct() %>%
  group_by(ExpCode, Label) %>%
  summarize(Count = n()) %>% 
  ungroup() %>% 
  filter(Label %in% c(left_E1, right_E1, left_E2, right_E2)) %>% 
  mutate(Hemi = substr(Label, 5,6),
         Hemisphere = if_else(Hemi == "lh", "left", if_else(Hemi == "rh", "right", "NA")),
         Col_name = paste(Hemisphere, paste0("E", ExpCode), sep = "_"),
         ROI = if_else(grepl("ffa1", Label), "FFA1", 
                       if_else(grepl("ffa2", Label), "FFA2", 
                               if_else(grepl("w-vs-o", Label), "VWFA", 
                                       if_else(grepl("o-vs-scr", Label), "LOC",
                                               "FFA")))),
         ROI = factor(ROI, levels = ROIOrder)) %>%  
  select(ROI, Col_name, Count) %>% 
  spread(Col_name, Count) %>% 
  select(ROI, left_E1, right_E1, everything()) 

The number of participants excluded from following analysis due to the vertex number being smaller than 50. (NA denotes no participants were excluded or VWFA was not found on the right hemisphere.)

5 Experiment 1: Chinese faces and Chinese characters for Chinese participants

5.1 Localizer

df_loc_E1 <- {
  df_clean_loc %>%  
    filter(ExpCode == 1) %>% 
    mutate(SubjCode = as.factor(SubjCode))
}
# nlevels(df_loc_E1$SubjCode) # number of subjects

The label used for FFA in this analysis is roi.rh.f20.f-vs-o.label.

5.1.1 rm-ANOVA

anova_loc_E1 <- aov_4(Resp ~ Conditions + (Conditions | SubjCode), data = df_loc_E1)

anova_loc_E1
## Anova Table (Type 3 tests)
## 
## Response: Resp
##       Effect          df  MSE         F ges p.value
## 1 Conditions 2.09, 35.56 0.10 68.78 *** .44  <.0001
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG

The above table displays the repeated-measures ANOVA results for the localizer in E1.

emm_loc_anova_E1 <- emmeans(anova_loc_E1, ~ Conditions)

emm_loc_anova_E1
##  Conditions emmean    SE   df lower.CL upper.CL
##  face         2.00 0.121 25.8    1.753     2.25
##  object       1.18 0.121 25.8    0.933     1.43
##  word         1.13 0.121 25.8    0.879     1.37
##  scrambled    0.80 0.121 25.8    0.552     1.05
## 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95

The above table displays the average respones for the localizer in E1.

contrast(emm_loc_anova_E1, "pairwise")
##  contrast           estimate     SE df t.ratio p.value
##  face - object        0.8198 0.0871 51  9.412  <.0001 
##  face - word          0.8738 0.0871 51 10.032  <.0001 
##  face - scrambled     1.2004 0.0871 51 13.782  <.0001 
##  object - word        0.0539 0.0871 51  0.619  0.9255 
##  object - scrambled   0.3806 0.0871 51  4.369  0.0003 
##  word - scrambled     0.3266 0.0871 51  3.750  0.0025 
## 
## P value adjustment: tukey method for comparing a family of 4 estimates

The above table displays the Posthoc anlaysis results (corrected with Tukey for 4 estimates).

5.1.2 Plot

plot_loc_E1 <- {
  ggplot(data = as.data.frame(emm_loc_anova_E1), aes(y = emmean, x = Conditions)) + # set the data, varialbes for x and y axises
    geom_col(position = "identity", color = "black", alpha = .7) +  # position of columns and countour of columns
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Neural responses in right FFA (Localizer)", x = "Stimuli", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    general_theme
}

plot_loc_E1

5.2 Main runs

# only keep the univariate data for E1
df_univar_agg_E1 <- {
  df_univar_agg %>% 
    filter(ExpCode == 1) %>% 
    mutate(FaceWord = factor(FaceWord, levels = facewordOrder),
           SubjCode = as.factor(SubjCode))
}

# only keep the multivariate (mvpa) data for E1
df_mvpa_acc_E1 <- {
  df_mvpa_acc %>% 
    filter(ExpCode == 1) %>% 
    mutate(ClassifyPair = factor(ClassifyPair, levels = pairOrder_E1),
           SubjCode = as.factor(SubjCode))
}

# only keep the similarity for E1
df_rate_simi_E1 <- {
  df_rate_simi %>% 
    filter(ExpCode == 1) %>% 
    mutate(SubjCode = as.factor(SubjCode))
}

5.2.1 Label:FFA

# label_lFFA_E1 <- label_lFFA[1] # "roi.lh.f20.f-vs-o.label" "roi.lh.f40.f-vs-o.label"
# label_rFFA_E1 <- label_rFFA[1] # "roi.rh.f20.f-vs-o.label" "roi.rh.f40.f-vs-o.label"

label_FFA_E1 <- c(label_lFFA_E1, label_rFFA_E1)

The label used for left FFA in Experiment 1 is roi.lh.f20.f-vs-o.label.
The label used for right FFA in Experiment 1 is roi.rh.f20.f-vs-o.label.

# only keep data for these two labels
df_univar_agg_E1_FFA <- filter(df_univar_agg_E1, Label %in% label_FFA_E1)
df_mvpa_acc_E1_FFA <- filter(df_mvpa_acc_E1, Label %in% label_FFA_E1)
df_simi_rate_E1_FFA <- filter(df_rate_simi_E1, Label %in% label_FFA_E1)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_FFA %>% filter(Label == label_rFFA_E1))$SubjCode))

df_univar_agg_E1_FFA %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

5.2.1.1 Univariate analyses

5.2.1.1.1 rm-ANOVA
5.2.1.1.1.1 Left FFA
anova_E1_lFFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_FFA, Label == label_lFFA_E1))

anova_E1_lFFA
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE       F  ges p.value
## 1        FaceWord       1, 11 0.19    2.92  .03     .12
## 2          Layout 2.20, 24.17 0.03 7.35 **  .03    .003
## 3 FaceWord:Layout 2.19, 24.14 0.06    0.60 .004     .57
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_lFFA <- emmeans(anova_E1_lFFA, ~ FaceWord * Layout)

emm_anova_E1_lFFA %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_lFFA, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word    0.153 0.0899 11 1.707   0.1158 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lFFA, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.0952 0.0462 33  2.061  0.1871 
##  intact - top             0.2145 0.0462 33  4.643  0.0003 
##  intact - bottom          0.0794 0.0462 33  1.720  0.3300 
##  misconfigured - top      0.1193 0.0462 33  2.583  0.0656 
##  misconfigured - bottom  -0.0158 0.0462 33 -0.341  0.9861 
##  top - bottom            -0.1350 0.0462 33 -2.924  0.0301 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_lFFA <- contrast(emm_anova_E1_lFFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lFFA
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             0.23780 0.1170 27.2  2.033  0.0519 
##  misconfigured .        face - word             0.17662 0.1170 27.2  1.510  0.1426 
##  top           .        face - word             0.10059 0.1170 27.2  0.860  0.3974 
##  bottom        .        face - word             0.09870 0.1170 27.2  0.844  0.4062 
##  .             face     intact - misconfigured  0.12577 0.0766 61.4  1.641  0.1059 
##  .             face     intact - top            0.28306 0.0766 61.4  3.693  0.0005 
##  .             face     intact - bottom         0.14897 0.0766 61.4  1.944  0.0565 
##  .             face     misconfigured - top     0.15729 0.0766 61.4  2.052  0.0444 
##  .             face     misconfigured - bottom  0.02320 0.0766 61.4  0.303  0.7631 
##  .             face     top - bottom           -0.13409 0.0766 61.4 -1.750  0.0852 
##  .             word     intact - misconfigured  0.06459 0.0766 61.4  0.843  0.4027 
##  .             word     intact - top            0.14585 0.0766 61.4  1.903  0.0617 
##  .             word     intact - bottom         0.00987 0.0766 61.4  0.129  0.8980 
##  .             word     misconfigured - top     0.08126 0.0766 61.4  1.060  0.2932 
##  .             word     misconfigured - bottom -0.05472 0.0766 61.4 -0.714  0.4780 
##  .             word     top - bottom           -0.13598 0.0766 61.4 -1.774  0.0810
5.2.1.1.1.2 Right FFA
anova_E1_rFFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_FFA, Label == label_rFFA_E1))

anova_E1_rFFA
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F ges p.value
## 1        FaceWord       1, 15 0.28 21.21 *** .12   .0003
## 2          Layout 2.51, 37.67 0.03 10.53 *** .02  <.0001
## 3 FaceWord:Layout 2.12, 31.84 0.06    3.85 * .01     .03
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_rFFA <- emmeans(anova_E1_rFFA, ~ FaceWord * Layout)

emm_anova_E1_rFFA %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_rFFA, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word    0.427 0.0927 15 4.606   0.0003 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rFFA, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.1822 0.0402 45  4.529  0.0002 
##  intact - top             0.1980 0.0402 45  4.922  0.0001 
##  intact - bottom          0.1692 0.0402 45  4.206  0.0007 
##  misconfigured - top      0.0158 0.0402 45  0.393  0.9792 
##  misconfigured - bottom  -0.0130 0.0402 45 -0.324  0.9881 
##  top - bottom            -0.0288 0.0402 45 -0.716  0.8900 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_rFFA <- contrast(emm_anova_E1_rFFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rFFA
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             0.63714 0.1117 29.6  5.702  <.0001 
##  misconfigured .        face - word             0.34458 0.1117 29.6  3.084  0.0044 
##  top           .        face - word             0.38306 0.1117 29.6  3.428  0.0018 
##  bottom        .        face - word             0.34325 0.1117 29.6  3.072  0.0045 
##  .             face     intact - misconfigured  0.32852 0.0649 85.4  5.062  <.0001 
##  .             face     intact - top            0.32508 0.0649 85.4  5.009  <.0001 
##  .             face     intact - bottom         0.31616 0.0649 85.4  4.872  <.0001 
##  .             face     misconfigured - top    -0.00344 0.0649 85.4 -0.053  0.9579 
##  .             face     misconfigured - bottom -0.01236 0.0649 85.4 -0.190  0.8495 
##  .             face     top - bottom           -0.00892 0.0649 85.4 -0.137  0.8910 
##  .             word     intact - misconfigured  0.03596 0.0649 85.4  0.554  0.5810 
##  .             word     intact - top            0.07101 0.0649 85.4  1.094  0.2770 
##  .             word     intact - bottom         0.02227 0.0649 85.4  0.343  0.7323 
##  .             word     misconfigured - top     0.03505 0.0649 85.4  0.540  0.5905 
##  .             word     misconfigured - bottom -0.01369 0.0649 85.4 -0.211  0.8335 
##  .             word     top - bottom           -0.04874 0.0649 85.4 -0.751  0.4547
5.2.1.1.2 Plot
sig_uni_E1_FFA <- c(signif(as.data.frame(contr_anova_E1_lFFA)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E1_rFFA)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_FFA <- sig_colors(sig_uni_E1_FFA)

# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lFFA))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_FFA <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lFFA), as.data.frame(emm_anova_E1_rFFA)))

plot_uni_E1_FFA <- {
  ggplot(data = desp_uni_E1_FFA, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in FFA (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises 
    geom_text(label = sig_uni_E1_FFA, color = color_uni_E1_FFA, size = sig_size, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E1_FFA.png', plot_uni_E1_FFA, width = 8, height = 5.5)

plot_uni_E1_FFA

The above figure shows the neural respones (beta values) in FFA for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

5.2.1.2 Multivarate analyses (MVPA)

5.2.1.2.1 One-sample t-test
one_mvpa_agg_E1_FFA <- {
  df_mvpa_acc_E1_FFA %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E1_FFA
5.2.1.2.2 Plot
plot_mvpa_E1_FFA <- {
  ggplot(data = one_mvpa_agg_E1_FFA, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding accuracy in FFA", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises
    geom_text(label = signif(one_mvpa_agg_E1_FFA$p), color = sig_colors(one_mvpa_agg_E1_FFA$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E1_FFA.png', plot_mvpa_E1_FFA, width = 12, height = 5)

plot_mvpa_E1_FFA

The above figure shows the decoding accuracy in FFA for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.1.3 Similarity of top + bottom to intact vs. misconfigured

5.2.1.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in FFA
one_simi_E1_FFA <- {
  df_simi_rate_E1_FFA %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E1_FFA
5.2.1.3.2 Plot
plot_simi_E1_FFA <- {
  ggplot(data = one_simi_E1_FFA, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in FFA", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E1_FFA$p, 4), color = sig_colors(one_simi_E1_FFA$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E1_FFA.png', plot_simi_E1_FFA, width = 14, height = 5)

plot_simi_E1_FFA

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in FFA. Patterns of top and bottom were combined with different weights, i.e., “face_top0.25-face_bottom0.75” denotes the linear combinations of face_top and face_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.2 Label:FFA1

# label_lFFA1_E1 <- label_lFFA1[1] # "roi.lh.f13.f-vs-o.ffa1.label" "roi.lh.f20.f-vs-o.ffa1.label"
# label_rFFA1_E1 <- label_rFFA1[1] # "roi.rh.f13.f-vs-o.ffa1.label"

label_FFA1_E1 <- c(label_lFFA1_E1, label_rFFA1_E1)

The label used for left FFA1 in Experiment 1 is roi.lh.f13.f-vs-o.ffa1.label.
The label used for right FFA1 in Experiment 1 is roi.rh.f13.f-vs-o.ffa1.label.

# only keep data for these two labels
df_univar_agg_E1_FFA1 <- filter(df_univar_agg_E1, Label %in% label_FFA1_E1)
df_mvpa_acc_E1_FFA1 <- filter(df_mvpa_acc_E1, Label %in% label_FFA1_E1)
df_simi_rate_E1_FFA1 <- filter(df_rate_simi_E1, Label %in% label_FFA1_E1)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_FFA1 %>% filter(Label == label_rFFA1_E1))$SubjCode))

df_univar_agg_E1_FFA1 %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

5.2.2.1 Univariate analyses

5.2.2.1.1 rm-ANOVA
5.2.2.1.1.1 Left FFA1
anova_E1_lFFA1 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_FFA1, Label == label_lFFA1_E1))

anova_E1_lFFA1
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE        F ges p.value
## 1        FaceWord       1, 11 0.28   4.52 + .10     .06
## 2          Layout 2.38, 26.17 0.03 9.19 *** .06   .0005
## 3 FaceWord:Layout 2.32, 25.50 0.04     2.07 .02     .14
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_lFFA1 <- emmeans(anova_E1_lFFA1, ~ FaceWord * Layout)

emm_anova_E1_lFFA1 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_lFFA1, ~ FaceWord), "pairwise")
##  contrast    estimate    SE df t.ratio p.value
##  face - word    0.229 0.108 11 2.127   0.0569 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lFFA1, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.0717 0.0459 33  1.564  0.4127 
##  intact - top             0.2274 0.0459 33  4.958  0.0001 
##  intact - bottom          0.1510 0.0459 33  3.294  0.0120 
##  misconfigured - top      0.1557 0.0459 33  3.395  0.0093 
##  misconfigured - bottom   0.0793 0.0459 33  1.730  0.3247 
##  top - bottom            -0.0763 0.0459 33 -1.664  0.3581 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_lFFA1 <- contrast(emm_anova_E1_lFFA1, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lFFA1
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             0.34875 0.1250 19.2  2.789  0.0116 
##  misconfigured .        face - word             0.15841 0.1250 19.2  1.267  0.2203 
##  top           .        face - word             0.28480 0.1250 19.2  2.278  0.0343 
##  bottom        .        face - word             0.12388 0.1250 19.2  0.991  0.3341 
##  .             face     intact - misconfigured  0.16687 0.0693 65.0  2.409  0.0189 
##  .             face     intact - top            0.25934 0.0693 65.0  3.743  0.0004 
##  .             face     intact - bottom         0.26348 0.0693 65.0  3.803  0.0003 
##  .             face     misconfigured - top     0.09247 0.0693 65.0  1.335  0.1866 
##  .             face     misconfigured - bottom  0.09661 0.0693 65.0  1.394  0.1679 
##  .             face     top - bottom            0.00414 0.0693 65.0  0.060  0.9526 
##  .             word     intact - misconfigured -0.02347 0.0693 65.0 -0.339  0.7359 
##  .             word     intact - top            0.19540 0.0693 65.0  2.820  0.0064 
##  .             word     intact - bottom         0.03861 0.0693 65.0  0.557  0.5792 
##  .             word     misconfigured - top     0.21887 0.0693 65.0  3.159  0.0024 
##  .             word     misconfigured - bottom  0.06208 0.0693 65.0  0.896  0.3735 
##  .             word     top - bottom           -0.15679 0.0693 65.0 -2.263  0.0270
5.2.2.1.1.2 Right FFA1
anova_E1_rFFA1 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_FFA1, Label == label_rFFA1_E1))

anova_E1_rFFA1
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F ges p.value
## 1        FaceWord       1, 15 0.29 24.99 *** .15   .0002
## 2          Layout 2.03, 30.48 0.07    3.20 + .01     .05
## 3 FaceWord:Layout 2.49, 37.37 0.07    3.57 * .01     .03
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_rFFA1 <- emmeans(anova_E1_rFFA1, ~ FaceWord * Layout)

emm_anova_E1_rFFA1 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_rFFA1, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word    0.473 0.0947 15 4.999   0.0002 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rFFA1, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate    SE df t.ratio p.value
##  intact - misconfigured   0.1333 0.054 45  2.469  0.0788 
##  intact - top             0.1530 0.054 45  2.833  0.0335 
##  intact - bottom          0.0822 0.054 45  1.523  0.4325 
##  misconfigured - top      0.0197 0.054 45  0.364  0.9833 
##  misconfigured - bottom  -0.0511 0.054 45 -0.945  0.7806 
##  top - bottom            -0.0707 0.054 45 -1.310  0.5616 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_rFFA1 <- contrast(emm_anova_E1_rFFA1, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rFFA1
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             0.71392 0.1206 35.0  5.921  <.0001 
##  misconfigured .        face - word             0.39410 0.1206 35.0  3.269  0.0024 
##  top           .        face - word             0.35859 0.1206 35.0  2.974  0.0053 
##  bottom        .        face - word             0.42642 0.1206 35.0  3.537  0.0012 
##  .             face     intact - misconfigured  0.29321 0.0814 88.7  3.601  0.0005 
##  .             face     intact - top            0.33064 0.0814 88.7  4.060  0.0001 
##  .             face     intact - bottom         0.22600 0.0814 88.7  2.775  0.0067 
##  .             face     misconfigured - top     0.03743 0.0814 88.7  0.460  0.6469 
##  .             face     misconfigured - bottom -0.06722 0.0814 88.7 -0.825  0.4113 
##  .             face     top - bottom           -0.10464 0.0814 88.7 -1.285  0.2021 
##  .             word     intact - misconfigured -0.02661 0.0814 88.7 -0.327  0.7446 
##  .             word     intact - top           -0.02469 0.0814 88.7 -0.303  0.7624 
##  .             word     intact - bottom        -0.06151 0.0814 88.7 -0.755  0.4521 
##  .             word     misconfigured - top     0.00192 0.0814 88.7  0.024  0.9813 
##  .             word     misconfigured - bottom -0.03490 0.0814 88.7 -0.429  0.6693 
##  .             word     top - bottom           -0.03681 0.0814 88.7 -0.452  0.6523
5.2.2.1.2 Plot
sig_uni_E1_FFA1 <- c(signif(as.data.frame(contr_anova_E1_lFFA1)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E1_rFFA1)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_FFA1 <- sig_colors(sig_uni_E1_FFA1)

# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lFFA1))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_FFA1 <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lFFA1), as.data.frame(emm_anova_E1_rFFA1)))

plot_uni_E1_FFA1 <- {
  ggplot(data = desp_uni_E1_FFA1, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in FFA1 (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = sig_uni_E1_FFA1, color = color_uni_E1_FFA1, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E1_FFA1.png', plot_uni_E1_FFA1, width = 8, height = 5.5)

plot_uni_E1_FFA1

The above figure shows the neural respones (beta values) in FFA1 for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

5.2.2.2 Multivarate analyses (MVPA)

5.2.2.2.1 One-sample t-test
# one-sample for results of mvpa E1 FFA1
one_mvpa_agg_E1_FFA1 <- {
  df_mvpa_acc_E1_FFA1 %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E1_FFA1
5.2.2.2.2 Plot
plot_mvpa_E1_FFA1 <- {
  ggplot(data = one_mvpa_agg_E1_FFA1, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    labs(title = "Decoding accuracy in FFA1", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises 
    geom_text(label = signif(one_mvpa_agg_E1_FFA1$p), color = sig_colors(one_mvpa_agg_E1_FFA1$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E1_FFA1.png', plot_mvpa_E1_FFA1, width = 12, height = 5)

plot_mvpa_E1_FFA1

The above figure shows the decoding accuracy in FFA1 for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.2.3 Similarity of top + bottom to intact vs. misconfigured

5.2.2.3.1 One-sample t-test
one_simi_E1_FFA1 <- {
  df_simi_rate_E1_FFA1 %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E1_FFA1
5.2.2.3.2 Plot
plot_simi_E1_FFA1 <- {
  ggplot(data = one_simi_E1_FFA1, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in FFA1", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E1_FFA1$p,4), color = sig_colors(one_simi_E1_FFA1$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E1_FFA1.png', plot_simi_E1_FFA1, width = 14, height = 5)

plot_simi_E1_FFA

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in FFA1. Patterns of top and bottom were combined with different weights, i.e., “face_top0.25-face_bottom0.75” denotes the linear combinations of face_top and face_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.3 Label:FFA2

# label_lFFA2_E1 <- label_lFFA2[1] # "roi.lh.f13.f-vs-o.ffa2.label"
# label_rFFA2_E1 <- label_rFFA2[1] # "roi.rh.f20.f-vs-o.ffa2.label" "roi.rh.f40.f-vs-o.ffa2.label"

label_FFA2_E1 <- c(label_lFFA2_E1, label_rFFA2_E1)

The label used for left FFA2 in Experiment 1 is roi.lh.f13.f-vs-o.ffa2.label.
The label used for right FFA2 in Experiment 1 is roi.rh.f13.f-vs-o.ffa2.label.

# only keep data for these two labels
df_univar_agg_E1_FFA2 <- filter(df_univar_agg_E1, Label %in% label_FFA2_E1)
df_mvpa_acc_E1_FFA2 <- filter(df_mvpa_acc_E1, Label %in% label_FFA2_E1)
df_simi_rate_E1_FFA2 <- filter(df_rate_simi_E1, Label %in% label_FFA2_E1)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_FFA2 %>% filter(Label == label_lFFA2_E1))$SubjCode))

df_univar_agg_E1_FFA2 %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

5.2.3.1 Univariate analyses

5.2.3.1.1 rm-ANOVA
5.2.3.1.1.1 Left FFA2
anova_E1_lFFA2 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_FFA2, Label == label_lFFA2_E1))

anova_E1_lFFA2
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE       F  ges p.value
## 1        FaceWord       1, 13 0.15    1.20 .010     .29
## 2          Layout 2.18, 28.34 0.03 6.90 **  .02    .003
## 3 FaceWord:Layout 2.65, 34.45 0.05    0.31 .002     .79
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_lFFA2 <- emmeans(anova_E1_lFFA2, ~ FaceWord * Layout)

emm_anova_E1_lFFA2 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_lFFA2, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word   0.0804 0.0733 13 1.097   0.2925 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lFFA2, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.0589 0.0389 39  1.515  0.4387 
##  intact - top             0.1686 0.0389 39  4.336  0.0006 
##  intact - bottom          0.0390 0.0389 39  1.004  0.7479 
##  misconfigured - top      0.1097 0.0389 39  2.821  0.0361 
##  misconfigured - bottom  -0.0198 0.0389 39 -0.511  0.9561 
##  top - bottom            -0.1295 0.0389 39 -3.331  0.0098 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_lFFA2 <- contrast(emm_anova_E1_lFFA2, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lFFA2
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             0.13568 0.1005 36.5  1.351  0.1851 
##  misconfigured .        face - word             0.04621 0.1005 36.5  0.460  0.6482 
##  top           .        face - word             0.09668 0.1005 36.5  0.962  0.3422 
##  bottom        .        face - word             0.04317 0.1005 36.5  0.430  0.6699 
##  .             face     intact - misconfigured  0.10362 0.0682 69.5  1.519  0.1334 
##  .             face     intact - top            0.18806 0.0682 69.5  2.756  0.0075 
##  .             face     intact - bottom         0.08530 0.0682 69.5  1.250  0.2154 
##  .             face     misconfigured - top     0.08444 0.0682 69.5  1.238  0.2200 
##  .             face     misconfigured - bottom -0.01832 0.0682 69.5 -0.269  0.7891 
##  .             face     top - bottom           -0.10276 0.0682 69.5 -1.506  0.1366 
##  .             word     intact - misconfigured  0.01415 0.0682 69.5  0.207  0.8363 
##  .             word     intact - top            0.14905 0.0682 69.5  2.185  0.0323 
##  .             word     intact - bottom        -0.00722 0.0682 69.5 -0.106  0.9160 
##  .             word     misconfigured - top     0.13490 0.0682 69.5  1.977  0.0520 
##  .             word     misconfigured - bottom -0.02137 0.0682 69.5 -0.313  0.7551 
##  .             word     top - bottom           -0.15627 0.0682 69.5 -2.290  0.0250
5.2.3.1.1.2 Right FFA2
anova_E1_rFFA2 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_FFA2, Label == label_rFFA2_E1))

anova_E1_rFFA2
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F  ges p.value
## 1        FaceWord       1, 15 0.12 18.38 ***  .09   .0006
## 2          Layout 2.39, 35.92 0.05   7.30 **  .04    .001
## 3 FaceWord:Layout 2.35, 35.19 0.05      1.89 .009     .16
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_rFFA2 <- emmeans(anova_E1_rFFA2, ~ FaceWord * Layout)

emm_anova_E1_rFFA2 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_rFFA2, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word    0.263 0.0614 15 4.287   0.0006 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rFFA2, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.2036 0.0487 45  4.185  0.0007 
##  intact - top             0.1840 0.0487 45  3.783  0.0025 
##  intact - bottom          0.1597 0.0487 45  3.281  0.0104 
##  misconfigured - top     -0.0196 0.0487 45 -0.403  0.9777 
##  misconfigured - bottom  -0.0440 0.0487 45 -0.904  0.8029 
##  top - bottom            -0.0244 0.0487 45 -0.501  0.9584 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_rFFA2 <- contrast(emm_anova_E1_rFFA2, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rFFA2
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             0.39107 0.0847 42.6  4.619  <.0001 
##  misconfigured .        face - word             0.17920 0.0847 42.6  2.116  0.0402 
##  top           .        face - word             0.26688 0.0847 42.6  3.152  0.0030 
##  bottom        .        face - word             0.21625 0.0847 42.6  2.554  0.0143 
##  .             face     intact - misconfigured  0.30956 0.0680 90.0  4.549  <.0001 
##  .             face     intact - top            0.24613 0.0680 90.0  3.617  0.0005 
##  .             face     intact - bottom         0.24706 0.0680 90.0  3.631  0.0005 
##  .             face     misconfigured - top    -0.06343 0.0680 90.0 -0.932  0.3538 
##  .             face     misconfigured - bottom -0.06250 0.0680 90.0 -0.918  0.3608 
##  .             face     top - bottom            0.00093 0.0680 90.0  0.014  0.9891 
##  .             word     intact - misconfigured  0.09769 0.0680 90.0  1.436  0.1546 
##  .             word     intact - top            0.12194 0.0680 90.0  1.792  0.0765 
##  .             word     intact - bottom         0.07224 0.0680 90.0  1.062  0.2912 
##  .             word     misconfigured - top     0.02426 0.0680 90.0  0.356  0.7223 
##  .             word     misconfigured - bottom -0.02545 0.0680 90.0 -0.374  0.7093 
##  .             word     top - bottom           -0.04970 0.0680 90.0 -0.730  0.4670
5.2.3.1.2 Plot
sig_uni_E1_FFA2 <- c(signif(as.data.frame(contr_anova_E1_lFFA2)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E1_rFFA2)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_FFA2 <- sig_colors(sig_uni_E1_FFA2)

# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lFFA2))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_FFA2 <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lFFA2), as.data.frame(emm_anova_E1_rFFA2)))

plot_uni_E1_FFA2 <- {
  ggplot(data = desp_uni_E1_FFA2, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in FFA2 (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises 
    geom_text(label = sig_uni_E1_FFA2, color = color_uni_E1_FFA2, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E1_FFA2.png', plot_uni_E1_FFA2, width = 8, height = 5.5)

plot_uni_E1_FFA2

The above figure shows the neural respones (beta values) in FFA2 for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

5.2.3.2 Multivarate analyses (MVPA)

5.2.3.2.1 One-sample t-test
# one-sample for results of mvpa E1 FFA2
one_mvpa_agg_E1_FFA2 <- {
  df_mvpa_acc_E1_FFA2 %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E1_FFA2
5.2.3.2.2 Plot
plot_mvpa_E1_FFA2 <- {
  ggplot(data = one_mvpa_agg_E1_FFA2, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    labs(title = "Decoding accuracy in FFA2", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = signif(one_mvpa_agg_E1_FFA2$p), color = sig_colors(one_mvpa_agg_E1_FFA2$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E1_FFA2.png', plot_mvpa_E1_FFA2, width = 12, height = 5)

plot_mvpa_E1_FFA2

The above figure shows the decoding accuracy in FFA2 for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.3.3 Similarity of top + bottom to intact vs. misconfigured

5.2.3.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in FFA
one_simi_E1_FFA2 <- {
  df_simi_rate_E1_FFA2 %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E1_FFA2
5.2.3.3.2 Plot
plot_simi_E1_FFA2 <- {
  ggplot(data = one_simi_E1_FFA2, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in FFA2", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E1_FFA2$p, 4), color = sig_colors(one_simi_E1_FFA2$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E1_FFA2.png', plot_simi_E1_FFA2, width = 14, height = 5)

plot_simi_E1_FFA2

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in FFA2. Patterns of top and bottom were combined with different weights, i.e., “face_top0.25-face_bottom0.75” denotes the linear combinations of face_top and face_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.4 Label: left Visual Word Form Area (VWFA)

# label_VWFA_E1 <- label_lVWFA[1] # "roi.lh.f13.w-vs-o.label"

The label used for (left) VWFA in Experiment 1 is roi.lh.f13.w-vs-o.label.

# only keep data for these two labels
df_univar_agg_E1_VWFA <- filter(df_univar_agg_E1, Label %in% label_VWFA_E1)
df_mvpa_acc_E1_VWFA <- filter(df_mvpa_acc_E1, Label %in% label_VWFA_E1)
df_simi_rate_E1_VWFA <- filter(df_rate_simi_E1, Label %in% label_VWFA_E1)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_VWFA %>% filter(Label == label_VWFA_E1))$SubjCode))

df_univar_agg_E1_VWFA %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

5.2.4.1 Univariate analyses

5.2.4.1.1 rm-ANOVA
anova_E1_VWFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_VWFA, Label == label_VWFA_E1))

anova_E1_VWFA
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F  ges p.value
## 1        FaceWord       1, 17 0.22 54.76 ***  .15  <.0001
## 2          Layout 2.63, 44.73 0.05    2.65 + .005     .07
## 3 FaceWord:Layout 2.54, 43.17 0.04  9.16 ***  .01   .0002
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_VWFA <- emmeans(anova_E1_VWFA, ~ FaceWord * Layout)

emm_anova_E1_VWFA %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_VWFA, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word   -0.581 0.0785 17 -7.400  <.0001 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_VWFA, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.0298 0.0494 51  0.604  0.9304 
##  intact - top             0.1305 0.0494 51  2.643  0.0516 
##  intact - bottom          0.0748 0.0494 51  1.514  0.4366 
##  misconfigured - top      0.1007 0.0494 51  2.039  0.1874 
##  misconfigured - bottom   0.0450 0.0494 51  0.911  0.7993 
##  top - bottom            -0.0557 0.0494 51 -1.128  0.6739 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_VWFA <- contrast(emm_anova_E1_VWFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_VWFA
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word             -0.4644 0.0929 31.7 -4.999  <.0001 
##  misconfigured .        face - word             -0.7228 0.0929 31.7 -7.781  <.0001 
##  top           .        face - word             -0.4001 0.0929 31.7 -4.307  0.0001 
##  bottom        .        face - word             -0.7361 0.0929 31.7 -7.923  <.0001 
##  .             face     intact - misconfigured   0.1590 0.0639 98.3  2.489  0.0145 
##  .             face     intact - top             0.0983 0.0639 98.3  1.539  0.1271 
##  .             face     intact - bottom          0.2106 0.0639 98.3  3.295  0.0014 
##  .             face     misconfigured - top     -0.0607 0.0639 98.3 -0.950  0.3445 
##  .             face     misconfigured - bottom   0.0516 0.0639 98.3  0.807  0.4217 
##  .             face     top - bottom             0.1123 0.0639 98.3  1.757  0.0821 
##  .             word     intact - misconfigured  -0.0994 0.0639 98.3 -1.556  0.1230 
##  .             word     intact - top             0.1626 0.0639 98.3  2.545  0.0125 
##  .             word     intact - bottom         -0.0611 0.0639 98.3 -0.956  0.3415 
##  .             word     misconfigured - top      0.2620 0.0639 98.3  4.100  0.0001 
##  .             word     misconfigured - bottom   0.0383 0.0639 98.3  0.600  0.5499 
##  .             word     top - bottom            -0.2237 0.0639 98.3 -3.500  0.0007
5.2.4.1.2 Plot
sig_uni_E1_VWFA <- c(signif(as.data.frame(contr_anova_E1_VWFA)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_VWFA <- sig_colors(sig_uni_E1_VWFA)

plot_uni_E1_VWFA <- {
  ggplot(data = as.data.frame(emm_anova_E1_VWFA), aes(y = emmean, x = FaceWord, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    # facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in (left) VWFA (Univariate)", x = "Stimuli", y = "Beta values") +  # set the names for main, x and y axises 
    geom_text(label = sig_uni_E1_VWFA, color = color_uni_E1_VWFA, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E1_VWFA.png', plot_uni_E1_VWFA, width = 8, height = 4)

plot_uni_E1_VWFA

The above figure shows the neural respones (beta values) in VWFA for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

5.2.4.2 Multivarate analyses (MVPA)

5.2.4.2.1 One-sample t-test
# one-sample for results of mvpa E1 VWFA
one_mvpa_agg_E1_VWFA <- {
  df_mvpa_acc_E1_VWFA %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E1_VWFA
5.2.4.2.2 Plot
color_uni_E1_VWFA <- 

plot_mvpa_E1_VWFA <- {
  ggplot(data = one_mvpa_agg_E1_VWFA, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding accuracy in VWFA", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises 
    geom_text(label = signif(one_mvpa_agg_E1_VWFA$p), color = sig_colors(one_mvpa_agg_E1_VWFA$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E1_VWFA.png', plot_mvpa_E1_VWFA, width = 9, height = 5)

plot_mvpa_E1_VWFA

The above figure shows the decoding accuracy in VWFA for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.4.3 Similarity of top + bottom to intact vs. misconfigured

5.2.4.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in VWFA
one_simi_E1_VWFA <- {
  df_simi_rate_E1_VWFA %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E1_VWFA
5.2.4.3.2 Plot
plot_simi_E1_VWFA <- {
  ggplot(data = one_simi_E1_VWFA, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in VWFA", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E1_VWFA$p, 4), color = sig_colors(one_simi_E1_VWFA$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E1_VWFA.png', plot_simi_E1_VWFA, width = 10, height = 5)

plot_simi_E1_VWFA

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in VWFA. Patterns of top and bottom were combined with different weights, i.e., “face_top0.25-face_bottom0.75” denotes the linear combinations of face_top and face_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.5 Label:Lateral Occipital Cortex

# label_lLOC_E1 <- label_lLOC[1] # 
# label_rLOC_E1 <- label_rLOC[1] # 

label_LOC_E1 <- c(label_lLOC_E1, label_rLOC_E1)

The label used for left LOC in Experiment 1 is roi.lh.f13.o-vs-scr.label.
The label used for right LOC in Experiment 1 is roi.rh.f13.o-vs-scr.label.

# only keep data for these two labels
df_univar_agg_E1_LOC <- filter(df_univar_agg_E1, Label %in% label_LOC_E1)
df_mvpa_acc_E1_LOC <- filter(df_mvpa_acc_E1, Label %in% label_LOC_E1)
df_simi_rate_E1_LOC <- filter(df_rate_simi_E1, Label %in% label_LOC_E1)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E1_LOC %>% filter(Label == label_lLOC_E1))$SubjCode))

df_univar_agg_E1_LOC %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

5.2.5.1 Univariate analyses

5.2.5.1.1 rm-ANOVA
5.2.5.1.1.1 Left LOC
anova_E1_lLOC <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_LOC, Label == label_lLOC_E1))

anova_E1_lLOC
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F    ges p.value
## 1        FaceWord       1, 18 0.18 21.31 ***    .07   .0002
## 2          Layout 2.10, 37.88 0.05      0.43  .0009     .66
## 3 FaceWord:Layout 2.29, 41.17 0.04      0.03 <.0001     .98
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_lLOC <- emmeans(anova_E1_lLOC, ~ FaceWord * Layout)

emm_anova_E1_lLOC %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_lLOC, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word   -0.317 0.0687 18 -4.616  0.0002 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_lLOC, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate    SE df t.ratio p.value
##  intact - misconfigured  0.03553 0.042 54  0.846  0.8323 
##  intact - top            0.04271 0.042 54  1.017  0.7404 
##  intact - bottom         0.03793 0.042 54  0.903  0.8033 
##  misconfigured - top     0.00718 0.042 54  0.171  0.9982 
##  misconfigured - bottom  0.00240 0.042 54  0.057  0.9999 
##  top - bottom           -0.00478 0.042 54 -0.114  0.9995 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_lLOC <- contrast(emm_anova_E1_lLOC, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_lLOC
##  Layout        FaceWord contrast               estimate     SE    df t.ratio p.value
##  intact        .        face - word            -0.32384 0.0844  37.7 -3.836  0.0005 
##  misconfigured .        face - word            -0.30978 0.0844  37.7 -3.669  0.0007 
##  top           .        face - word            -0.30720 0.0844  37.7 -3.639  0.0008 
##  bottom        .        face - word            -0.32860 0.0844  37.7 -3.892  0.0004 
##  .             face     intact - misconfigured  0.02850 0.0580 107.8  0.491  0.6243 
##  .             face     intact - top            0.03438 0.0580 107.8  0.593  0.5546 
##  .             face     intact - bottom         0.04031 0.0580 107.8  0.695  0.4887 
##  .             face     misconfigured - top     0.00589 0.0580 107.8  0.101  0.9194 
##  .             face     misconfigured - bottom  0.01181 0.0580 107.8  0.204  0.8391 
##  .             face     top - bottom            0.00592 0.0580 107.8  0.102  0.9189 
##  .             word     intact - misconfigured  0.04256 0.0580 107.8  0.734  0.4648 
##  .             word     intact - top            0.05103 0.0580 107.8  0.880  0.3810 
##  .             word     intact - bottom         0.03555 0.0580 107.8  0.613  0.5413 
##  .             word     misconfigured - top     0.00847 0.0580 107.8  0.146  0.8842 
##  .             word     misconfigured - bottom -0.00701 0.0580 107.8 -0.121  0.9040 
##  .             word     top - bottom           -0.01548 0.0580 107.8 -0.267  0.7901
5.2.5.1.1.2 Right LOC
anova_E1_rLOC <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E1_LOC, Label == label_rLOC_E1))

anova_E1_rLOC
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE      F   ges p.value
## 1        FaceWord       1, 16 0.25 3.70 +   .01     .07
## 2          Layout 2.26, 36.17 0.08   0.71  .002     .52
## 3 FaceWord:Layout 2.40, 38.42 0.05   0.41 .0006     .71
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E1_rLOC <- emmeans(anova_E1_rLOC, ~ FaceWord * Layout)

emm_anova_E1_rLOC %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E1_rLOC, ~ FaceWord), "pairwise")
##  contrast    estimate     SE df t.ratio p.value
##  face - word   -0.166 0.0861 16 -1.923  0.0725 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E1_rLOC, ~ Layout), "pairwise") # , adjust = "none"
##  contrast                estimate     SE df t.ratio p.value
##  intact - misconfigured  0.082239 0.0595 48  1.381  0.5172 
##  intact - top            0.060637 0.0595 48  1.018  0.7396 
##  intact - bottom         0.060014 0.0595 48  1.008  0.7456 
##  misconfigured - top    -0.021602 0.0595 48 -0.363  0.9835 
##  misconfigured - bottom -0.022225 0.0595 48 -0.373  0.9821 
##  top - bottom           -0.000623 0.0595 48 -0.010  1.0000 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E1_rLOC <- contrast(emm_anova_E1_rLOC, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E1, interaction = "pairwise") # , adjust = "none"
contr_anova_E1_rLOC
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        face - word            -0.11262 0.1039 31.7 -1.084  0.2867 
##  misconfigured .        face - word            -0.21399 0.1039 31.7 -2.059  0.0478 
##  top           .        face - word            -0.15496 0.1039 31.7 -1.491  0.1458 
##  bottom        .        face - word            -0.18075 0.1039 31.7 -1.739  0.0917 
##  .             face     intact - misconfigured  0.13293 0.0762 91.5  1.745  0.0843 
##  .             face     intact - top            0.08181 0.0762 91.5  1.074  0.2856 
##  .             face     intact - bottom         0.09408 0.0762 91.5  1.235  0.2199 
##  .             face     misconfigured - top    -0.05112 0.0762 91.5 -0.671  0.5038 
##  .             face     misconfigured - bottom -0.03885 0.0762 91.5 -0.510  0.6112 
##  .             face     top - bottom            0.01227 0.0762 91.5  0.161  0.8724 
##  .             word     intact - misconfigured  0.03155 0.0762 91.5  0.414  0.6797 
##  .             word     intact - top            0.03946 0.0762 91.5  0.518  0.6056 
##  .             word     intact - bottom         0.02595 0.0762 91.5  0.341  0.7341 
##  .             word     misconfigured - top     0.00791 0.0762 91.5  0.104  0.9175 
##  .             word     misconfigured - bottom -0.00560 0.0762 91.5 -0.074  0.9415 
##  .             word     top - bottom           -0.01351 0.0762 91.5 -0.177  0.8596
5.2.5.1.2 Plot
sig_uni_E1_LOC <- c(signif(as.data.frame(contr_anova_E1_lLOC)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E1_rLOC)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E1_LOC <- sig_colors(sig_uni_E1_LOC)

# add the column of Hemisphere
nRow_E1 <-nrow(as.data.frame(emm_anova_E1_lLOC))
Hemisphere <- c(rep("left", nRow_E1), rep("right", nRow_E1))
desp_uni_E1_LOC <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E1_lLOC), as.data.frame(emm_anova_E1_rLOC)))

plot_uni_E1_LOC <- {
  ggplot(data = desp_uni_E1_LOC, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in LOC (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = sig_uni_E1_LOC, color = color_uni_E1_LOC, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E1_LOC.png', plot_uni_E1_LOC, width = 8, height = 5.5)

plot_uni_E1_LOC

The above figure shows the neural respones (beta values) in LOC for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

5.2.5.2 Multivarate analyses (MVPA)

5.2.5.2.1 One-sample t-test
# one-sample for results of mvpa E1 LOC
one_mvpa_agg_E1_LOC <- {
  df_mvpa_acc_E1_LOC %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E1_LOC
5.2.5.2.2 Plot
plot_mvpa_E1_LOC <- {
  ggplot(data = one_mvpa_agg_E1_LOC, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = signif(one_mvpa_agg_E1_LOC$p), color = sig_colors(one_mvpa_agg_E1_LOC$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E1_LOC.png', plot_mvpa_E1_LOC, width = 12, height = 5)

plot_mvpa_E1_LOC

The above figure shows the decoding accuracy in LOC for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

5.2.5.3 Similarity of top + bottom to intact vs. misconfigured

5.2.5.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in LOC
one_simi_E1_LOC <- {
  df_simi_rate_E1_LOC %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E1_LOC
5.2.5.3.2 Plot
plot_simi_E1_LOC <- {
  ggplot(data = one_simi_E1_LOC, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in LOC", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E1_LOC$p, 4), color = sig_colors(one_simi_E1_LOC$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E1_LOC.png', plot_simi_E1_LOC, width = 14, height = 5)

plot_simi_E1_LOC

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in LOC. Patterns of top and bottom were combined with different weights, i.e., “face_top0.25-face_bottom0.75” denotes the linear combinations of face_top and face_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6 Experiment 2: Chinese characters and English words for English speakers

6.1 localizer

df_loc_E2 <- {
  df_clean_loc %>% 
    filter(ExpCode == 2) %>% 
    mutate(SubjCode = as.factor(SubjCode))
}
# nlevels(df_loc_E2$SubjCode) # number of subjects

The label used for FFA in this analysis is roi.rh.f20.f-vs-o.label.

6.1.1 rm-ANOVA

anova_loc_E2 <- aov_4(Resp ~ Conditions + (Conditions | SubjCode), data = df_loc_E2)

anova_loc_E2
## Anova Table (Type 3 tests)
## 
## Response: Resp
##       Effect          df  MSE          F ges p.value
## 1 Conditions 2.31, 41.62 0.04 174.98 *** .60  <.0001
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_loc_anova_E2 <- emmeans(anova_loc_E2, ~ Conditions)

emm_loc_anova_E2
##  Conditions emmean     SE   df lower.CL upper.CL
##  face        1.545 0.0909 24.8    1.358    1.732
##  object      0.779 0.0909 24.8    0.592    0.967
##  word        0.318 0.0909 24.8    0.131    0.505
##  scrambled   0.499 0.0909 24.8    0.311    0.686
## 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95
contrast(emm_loc_anova_E2, "pairwise")
##  contrast           estimate     SE df t.ratio p.value
##  face - object         0.766 0.0578 54 13.238  <.0001 
##  face - word           1.227 0.0578 54 21.218  <.0001 
##  face - scrambled      1.046 0.0578 54 18.093  <.0001 
##  object - word         0.461 0.0578 54  7.980  <.0001 
##  object - scrambled    0.281 0.0578 54  4.855  0.0001 
##  word - scrambled     -0.181 0.0578 54 -3.125  0.0147 
## 
## P value adjustment: tukey method for comparing a family of 4 estimates

6.1.2 Plot

plot_loc_E2 <- {
  ggplot(data = as.data.frame(emm_loc_anova_E2), aes(y = emmean, x = Conditions)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Neural responses in right FFA (Localizer)", x = "Stimuli", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    general_theme
}

plot_loc_E2

6.2 Main runs

# only keep the univariate data for E2
df_univar_agg_E2 <- {
  df_univar_agg %>% 
    filter(ExpCode == 2) %>% 
    mutate(FaceWord = factor(FaceWord, levels = wordsOrder),
           SubjCode = as.factor(SubjCode))
}

# only keep the multivariate (mvpa) data for E2
df_mvpa_acc_E2 <- {
  df_mvpa_acc %>% 
    filter(ExpCode == 2) %>% 
    mutate(ClassifyPair = factor(ClassifyPair, levels = pairOrder_E2),
           SubjCode = as.factor(SubjCode))
}

# only keep the similarity for E2
df_rate_simi_E2 <- {
  df_rate_simi %>% 
    filter(ExpCode == 2) %>% 
    mutate(SubjCode = as.factor(SubjCode))
}

6.2.1 Label:FFA

# label_lFFA_E2 <- label_lFFA[1] # "roi.lh.f20.f-vs-o.label" "roi.lh.f40.f-vs-o.label"
# label_rFFA_E2 <- label_rFFA[1] # "roi.rh.f20.f-vs-o.label" "roi.rh.f40.f-vs-o.label"

label_FFA_E2 <- c(label_lFFA_E2, label_rFFA_E2)

The label used for left FFA in Experiment 2 is roi.lh.f20.f-vs-o.label.
The label used for right FFA in Experiment 2 is roi.rh.f20.f-vs-o.label.

# only keep data for these two labels
df_univar_agg_E2_FFA <- filter(df_univar_agg_E2, Label %in% label_FFA_E2)
df_mvpa_acc_E2_FFA <- filter(df_mvpa_acc_E2, Label %in% label_FFA_E2)
df_simi_rate_E2_FFA <- filter(df_rate_simi_E2, Label %in% label_FFA_E2)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E2_FFA %>% filter(Label == label_lFFA_E2))$SubjCode))

df_univar_agg_E2_FFA %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

6.2.1.1 Univariate analyses

6.2.1.1.1 rm-ANOVA
6.2.1.1.1.1 Left FFA
anova_E2_lFFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_FFA, Label == label_lFFA_E2))

anova_E2_lFFA
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE        F  ges p.value
## 1        FaceWord       1, 13 0.18 11.15 **  .12    .005
## 2          Layout 2.57, 33.43 0.02     0.53 .001     .64
## 3 FaceWord:Layout 2.67, 34.66 0.03   3.48 *  .02     .03
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_lFFA <- emmeans(anova_E2_lFFA, ~ FaceWord * Layout)

emm_anova_E2_lFFA %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_lFFA, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English    -0.27 0.0808 13 -3.339  0.0053 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_lFFA, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate    SE df t.ratio p.value
##  intact - misconfigured  0.02718 0.031 39  0.877  0.8164 
##  intact - top            0.03179 0.031 39  1.026  0.7351 
##  intact - bottom         0.00439 0.031 39  0.142  0.9990 
##  misconfigured - top     0.00461 0.031 39  0.149  0.9988 
##  misconfigured - bottom -0.02279 0.031 39 -0.736  0.8821 
##  top - bottom           -0.02740 0.031 39 -0.885  0.8128 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_lFFA <- contrast(emm_anova_E2_lFFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_lFFA
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English      -0.34958 0.0956 24.2 -3.655  0.0012 
##  misconfigured .        Chinese - English      -0.27322 0.0956 24.2 -2.857  0.0086 
##  top           .        Chinese - English      -0.11262 0.0956 24.2 -1.178  0.2504 
##  bottom        .        Chinese - English      -0.34340 0.0956 24.2 -3.591  0.0015 
##  .             Chinese  intact - misconfigured -0.01100 0.0520 71.9 -0.211  0.8332 
##  .             Chinese  intact - top           -0.08669 0.0520 71.9 -1.666  0.1000 
##  .             Chinese  intact - bottom         0.00130 0.0520 71.9  0.025  0.9801 
##  .             Chinese  misconfigured - top    -0.07569 0.0520 71.9 -1.455  0.1501 
##  .             Chinese  misconfigured - bottom  0.01230 0.0520 71.9  0.236  0.8137 
##  .             Chinese  top - bottom            0.08799 0.0520 71.9  1.691  0.0951 
##  .             English  intact - misconfigured  0.06535 0.0520 71.9  1.256  0.2132 
##  .             English  intact - top            0.15027 0.0520 71.9  2.888  0.0051 
##  .             English  intact - bottom         0.00748 0.0520 71.9  0.144  0.8862 
##  .             English  misconfigured - top     0.08491 0.0520 71.9  1.632  0.1071 
##  .             English  misconfigured - bottom -0.05788 0.0520 71.9 -1.112  0.2697 
##  .             English  top - bottom           -0.14279 0.0520 71.9 -2.744  0.0077
6.2.1.1.1.2 Right FFA
anova_E2_rFFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_FFA, Label == label_rFFA_E2))

anova_E2_rFFA
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE    F  ges p.value
## 1        FaceWord       1, 17 0.06 0.40 .003     .54
## 2          Layout 2.54, 43.11 0.02 2.20  .01     .11
## 3 FaceWord:Layout 2.48, 42.09 0.02 1.08 .006     .36
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_rFFA <- emmeans(anova_E2_rFFA, ~ FaceWord * Layout)

emm_anova_E2_rFFA %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_rFFA, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English   0.0266 0.0423 17 0.630   0.5370 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_rFFA, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured  0.04620 0.0303 51  1.525  0.4305 
##  intact - top           -0.01834 0.0303 51 -0.605  0.9299 
##  intact - bottom         0.04243 0.0303 51  1.400  0.5049 
##  misconfigured - top    -0.06454 0.0303 51 -2.130  0.1574 
##  misconfigured - bottom -0.00376 0.0303 51 -0.124  0.9993 
##  top - bottom            0.06078 0.0303 51  2.006  0.1993 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_rFFA <- contrast(emm_anova_E2_rFFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_rFFA
##  Layout        FaceWord contrast               estimate     SE    df t.ratio p.value
##  intact        .        Chinese - English      -0.01811 0.0564  44.9 -0.321  0.7497 
##  misconfigured .        Chinese - English       0.06380 0.0564  44.9  1.131  0.2642 
##  top           .        Chinese - English       0.06656 0.0564  44.9  1.180  0.2444 
##  bottom        .        Chinese - English      -0.00571 0.0564  44.9 -0.101  0.9198 
##  .             Chinese  intact - misconfigured  0.00524 0.0430 102.0  0.122  0.9033 
##  .             Chinese  intact - top           -0.06068 0.0430 102.0 -1.411  0.1613 
##  .             Chinese  intact - bottom         0.03623 0.0430 102.0  0.842  0.4015 
##  .             Chinese  misconfigured - top    -0.06592 0.0430 102.0 -1.533  0.1284 
##  .             Chinese  misconfigured - bottom  0.03099 0.0430 102.0  0.721  0.4728 
##  .             Chinese  top - bottom            0.09691 0.0430 102.0  2.253  0.0264 
##  .             English  intact - misconfigured  0.08715 0.0430 102.0  2.026  0.0453 
##  .             English  intact - top            0.02399 0.0430 102.0  0.558  0.5782 
##  .             English  intact - bottom         0.04863 0.0430 102.0  1.131  0.2608 
##  .             English  misconfigured - top    -0.06316 0.0430 102.0 -1.469  0.1450 
##  .             English  misconfigured - bottom -0.03852 0.0430 102.0 -0.896  0.3725 
##  .             English  top - bottom            0.02464 0.0430 102.0  0.573  0.5679
6.2.1.1.2 Plot
sig_uni_E2_FFA <- c(signif(as.data.frame(contr_anova_E2_lFFA)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E2_rFFA)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E2_FFA <- sig_colors(sig_uni_E2_FFA)

# add the column of Hemisphere
nRow_E2 <-nrow(as.data.frame(emm_anova_E2_lFFA))
Hemisphere <- c(rep("left", nRow_E2), rep("right", nRow_E2))
desp_uni_E2_FFA <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E2_lFFA), as.data.frame(emm_anova_E2_rFFA)))

plot_uni_E2_FFA <- {
  ggplot(data = desp_uni_E2_FFA, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(-0.2, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in FFA (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
     geom_text(label = sig_uni_E2_FFA, color = color_uni_E2_FFA, size = 5, nudge_y = 0.3, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E2_FFA.png', plot_uni_E2_FFA, width = 8, height = 5.5)

plot_uni_E2_FFA

The above figure shows the neural respones (beta values) in FFA for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

6.2.1.2 Multivarate analyses (MVPA)

6.2.1.2.1 One-sample t-test
# one-sample for results of mvpa E2 FFA
one_mvpa_agg_E2_FFA <- {
  df_mvpa_acc_E2_FFA %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E2_FFA
6.2.1.2.2 Plot
plot_mvpa_E2_FFA <- {
  ggplot(data = one_mvpa_agg_E2_FFA, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding Accuracy in FFA", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises 
    geom_text(label = signif(one_mvpa_agg_E2_FFA$p), color = sig_colors(one_mvpa_agg_E2_FFA$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E2_FFA.png', plot_mvpa_E2_FFA, width = 12, height = 5)

plot_mvpa_E2_FFA

The above figure shows the decoding accuracy in FFA for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.1.3 Similarity of top + bottom to intact vs. misconfigured

6.2.1.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in FFA
one_simi_E2_FFA <- {
  df_simi_rate_E2_FFA %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E2_FFA
6.2.1.3.2 Plot
plot_simi_E2_FFA <- {
  ggplot(data = one_simi_E2_FFA, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in FFA", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E2_FFA$p, 4), color = sig_colors(one_simi_E2_FFA$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E2_FFA.png', plot_simi_E2_FFA, width = 14, height = 5)

plot_simi_E2_FFA

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in FFA. Patterns of top and bottom were combined with different weights, i.e., “Chinese_top0.25-Chinese_bottom0.75” denotes the linear combinations of Chinese_top and Chinese_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.2 Label:FFA1

# label_lFFA1_E2 <- label_lFFA1[1] # "roi.lh.f13.f-vs-o.ffa1.label" "roi.lh.f20.f-vs-o.ffa1.label"
# label_rFFA1_E2 <- label_rFFA1[1] # "roi.rh.f13.f-vs-o.ffa1.label"

label_FFA1_E2 <- c(label_lFFA1_E2, label_rFFA1_E2)

The label used for left FFA1 in Experiment 2 is roi.lh.f13.f-vs-o.ffa1.label.
The label used for right FFA1 in Experiment 2 is roi.rh.f13.f-vs-o.ffa1.label.

# only keep data for these two labels
df_univar_agg_E2_FFA1 <- filter(df_univar_agg_E2, Label %in% label_FFA1_E2)
df_mvpa_acc_E2_FFA1 <- filter(df_mvpa_acc_E2, Label %in% label_FFA1_E2)
df_simi_rate_E2_FFA1 <- filter(df_rate_simi_E2, Label %in% label_FFA1_E2)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E2_FFA1 %>% filter(Label == label_rFFA1_E2))$SubjCode))

df_univar_agg_E2_FFA1 %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

6.2.2.1 Univariate analyses

6.2.2.1.1 rm-ANOVA
6.2.2.1.1.1 Left FFA1
anova_E2_lFFA1 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_FFA1, Label == label_lFFA1_E2))

anova_E2_lFFA1
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE        F ges p.value
## 1        FaceWord       1, 10 0.17 12.43 ** .09    .005
## 2          Layout 2.00, 20.05 0.04   3.40 + .01     .05
## 3 FaceWord:Layout 2.06, 20.61 0.04  6.09 ** .02    .008
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_lFFA1 <- emmeans(anova_E2_lFFA1, ~ FaceWord * Layout)

emm_anova_E2_lFFA1 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_lFFA1, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English    -0.31 0.0878 10 -3.525  0.0055 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_lFFA1, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured -0.13120 0.0465 30 -2.822  0.0396 
##  intact - top           -0.00867 0.0465 30 -0.187  0.9976 
##  intact - bottom        -0.06443 0.0465 30 -1.386  0.5175 
##  misconfigured - top     0.12252 0.0465 30  2.636  0.0601 
##  misconfigured - bottom  0.06676 0.0465 30  1.436  0.4874 
##  top - bottom           -0.05576 0.0465 30 -1.199  0.6319 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_lFFA1 <- contrast(emm_anova_E2_lFFA1, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_lFFA1
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English       -0.3362 0.1087 21.4 -3.093  0.0054 
##  misconfigured .        Chinese - English       -0.4461 0.1087 21.4 -4.104  0.0005 
##  top           .        Chinese - English       -0.0449 0.1087 21.4 -0.413  0.6835 
##  bottom        .        Chinese - English       -0.4116 0.1087 21.4 -3.787  0.0011 
##  .             Chinese  intact - misconfigured  -0.0762 0.0699 59.2 -1.090  0.2803 
##  .             Chinese  intact - top            -0.1543 0.0699 59.2 -2.206  0.0313 
##  .             Chinese  intact - bottom         -0.0267 0.0699 59.2 -0.382  0.7041 
##  .             Chinese  misconfigured - top     -0.0781 0.0699 59.2 -1.116  0.2689 
##  .             Chinese  misconfigured - bottom   0.0495 0.0699 59.2  0.708  0.4817 
##  .             Chinese  top - bottom             0.1276 0.0699 59.2  1.824  0.0732 
##  .             English  intact - misconfigured  -0.1862 0.0699 59.2 -2.662  0.0100 
##  .             English  intact - top             0.1369 0.0699 59.2  1.958  0.0550 
##  .             English  intact - bottom         -0.1022 0.0699 59.2 -1.461  0.1494 
##  .             English  misconfigured - top      0.3231 0.0699 59.2  4.619  <.0001 
##  .             English  misconfigured - bottom   0.0840 0.0699 59.2  1.201  0.2346 
##  .             English  top - bottom            -0.2391 0.0699 59.2 -3.418  0.0011
6.2.2.1.1.2 Right FFA1
anova_E2_rFFA1 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_FFA1, Label == label_rFFA1_E2))

anova_E2_rFFA1
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE    F  ges p.value
## 1        FaceWord       1, 15 0.14 1.03 .006     .33
## 2          Layout 2.65, 39.71 0.04 1.25 .005     .30
## 3 FaceWord:Layout 2.45, 36.71 0.03 1.40 .004     .26
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_rFFA1 <- emmeans(anova_E2_rFFA1, ~ FaceWord * Layout)

emm_anova_E2_rFFA1 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_rFFA1, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English   0.0665 0.0654 15 1.017   0.3253 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_rFFA1, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.0376 0.0462 45  0.814  0.8476 
##  intact - top            -0.0480 0.0462 45 -1.038  0.7283 
##  intact - bottom          0.0173 0.0462 45  0.374  0.9819 
##  misconfigured - top     -0.0856 0.0462 45 -1.852  0.2633 
##  misconfigured - bottom  -0.0203 0.0462 45 -0.440  0.9713 
##  top - bottom             0.0653 0.0462 45  1.412  0.4986 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_rFFA1 <- contrast(emm_anova_E2_rFFA1, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_rFFA1
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English       0.04533 0.0809 32.1  0.560  0.5793 
##  misconfigured .        Chinese - English       0.13991 0.0809 32.1  1.729  0.0935 
##  top           .        Chinese - English       0.09311 0.0809 32.1  1.150  0.2584 
##  bottom        .        Chinese - English      -0.01220 0.0809 32.1 -0.151  0.8811 
##  .             Chinese  intact - misconfigured -0.00966 0.0604 87.4 -0.160  0.8733 
##  .             Chinese  intact - top           -0.07188 0.0604 87.4 -1.190  0.2374 
##  .             Chinese  intact - bottom         0.04607 0.0604 87.4  0.762  0.4479 
##  .             Chinese  misconfigured - top    -0.06221 0.0604 87.4 -1.030  0.3060 
##  .             Chinese  misconfigured - bottom  0.05573 0.0604 87.4  0.922  0.3589 
##  .             Chinese  top - bottom            0.11794 0.0604 87.4  1.952  0.0541 
##  .             English  intact - misconfigured  0.08492 0.0604 87.4  1.405  0.1634 
##  .             English  intact - top           -0.02409 0.0604 87.4 -0.399  0.6911 
##  .             English  intact - bottom        -0.01146 0.0604 87.4 -0.190  0.8501 
##  .             English  misconfigured - top    -0.10901 0.0604 87.4 -1.804  0.0747 
##  .             English  misconfigured - bottom -0.09637 0.0604 87.4 -1.595  0.1143 
##  .             English  top - bottom            0.01263 0.0604 87.4  0.209  0.8349
6.2.2.1.2 Plot
sig_uni_E2_FFA1 <- c(signif(as.data.frame(contr_anova_E2_lFFA1)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E2_rFFA1)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E2_FFA1 <- sig_colors(sig_uni_E2_FFA1)

# add the column of Hemisphere
nRow_E2 <-nrow(as.data.frame(emm_anova_E2_lFFA1))
Hemisphere <- c(rep("left", nRow_E2), rep("right", nRow_E2))
desp_uni_E2_FFA1 <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E2_lFFA1), as.data.frame(emm_anova_E2_rFFA1)))

plot_uni_E2_FFA1 <- {
  ggplot(data = desp_uni_E2_FFA1, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in FFA1 (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = sig_uni_E2_FFA1, color = color_uni_E2_FFA1, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E2_FFA1.png', plot_uni_E2_FFA1, width = 8, height = 5.5)

plot_uni_E2_FFA1

The above figure shows the neural respones (beta values) in FFA1 for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

6.2.2.2 Multivarate analyses (MVPA)

6.2.2.2.1 One-sample t-test
# one-sample for results of mvpa E2 FFA1
one_mvpa_agg_E2_FFA1 <- {
  df_mvpa_acc_E2_FFA1 %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E2_FFA1
6.2.2.2.2 Plot
plot_mvpa_E2_FFA1 <- {
  ggplot(data = one_mvpa_agg_E2_FFA1, aes(y = mean, x = ClassifyPair, fill=ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding Accuracy in FFA1", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises 
    geom_text(label = signif(one_mvpa_agg_E2_FFA1$p), color = sig_colors(one_mvpa_agg_E2_FFA1$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E2_FFA1.png', plot_mvpa_E2_FFA1, width = 12, height = 5)

plot_mvpa_E2_FFA1

The above figure shows the decoding accuracy in FFA1 for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.2.3 Similarity of top + bottom to intact vs. misconfigured

6.2.2.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in FFA1
one_simi_E2_FFA1 <- {
  df_simi_rate_E2_FFA1 %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E2_FFA1
6.2.2.3.2 Plot
plot_simi_E2_FFA1 <- {
  ggplot(data = one_simi_E2_FFA1, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in FFA1", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E2_FFA1$p, 4), color = sig_colors(one_simi_E2_FFA1$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E2_FFA1.png', plot_simi_E2_FFA1, width = 14, height = 5)

plot_simi_E2_FFA1

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in FFA1. Patterns of top and bottom were combined with different weights, i.e., “Chinese_top0.25-Chinese_bottom0.75” denotes the linear combinations of Chinese_top and Chinese_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.3 Label:FFA2

# label_lFFA2_E2 <- label_lFFA2[1] # "roi.lh.f13.f-vs-o.ffa2.label"
# label_rFFA2_E2 <- label_rFFA2[1] # "roi.rh.f20.f-vs-o.ffa2.label" "roi.rh.f40.f-vs-o.ffa2.label"

label_FFA2_E2 <- c(label_lFFA2_E2, label_rFFA2_E2)

The label used for left FFA2 in Experiment 1 is roi.lh.f13.f-vs-o.ffa2.label.
The label used for right FFA2 in Experiment 1 is roi.rh.f13.f-vs-o.ffa2.label.

# only keep data for these two labels
df_univar_agg_E2_FFA2 <- filter(df_univar_agg_E2, Label %in% label_FFA2_E2)
df_mvpa_acc_E2_FFA2 <- filter(df_mvpa_acc_E2, Label %in% label_FFA2_E2)
df_simi_rate_E2_FFA2 <- filter(df_rate_simi_E2, Label %in% label_FFA2_E2)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E2_FFA2 %>% filter(Label == label_rFFA2_E2))$SubjCode))

df_univar_agg_E2_FFA2 %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

6.2.3.1 Univariate analyses

6.2.3.1.1 rm-ANOVA
6.2.3.1.1.1 Left FFA2
anova_E2_lFFA2 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_FFA2, Label == label_lFFA2_E2))

anova_E2_lFFA2
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE        F  ges p.value
## 1        FaceWord       1, 13 0.11 11.43 **  .08    .005
## 2          Layout 2.87, 37.35 0.02     0.86 .003     .47
## 3 FaceWord:Layout 2.83, 36.84 0.02   2.63 +  .01     .07
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_lFFA2 <- emmeans(anova_E2_lFFA2, ~ FaceWord * Layout)

emm_anova_E2_lFFA2 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_lFFA2, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English   -0.215 0.0635 13 -3.381  0.0049 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_lFFA2, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured  0.02176 0.0333 39  0.653  0.9138 
##  intact - top            0.04288 0.0333 39  1.287  0.5763 
##  intact - bottom        -0.00452 0.0333 39 -0.136  0.9991 
##  misconfigured - top     0.02112 0.0333 39  0.634  0.9203 
##  misconfigured - bottom -0.02628 0.0333 39 -0.789  0.8590 
##  top - bottom           -0.04740 0.0333 39 -1.423  0.4929 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_lFFA2 <- contrast(emm_anova_E2_lFFA2, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_lFFA2
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English      -0.28796 0.0805 30.0 -3.575  0.0012 
##  misconfigured .        Chinese - English      -0.24848 0.0805 30.0 -3.085  0.0044 
##  top           .        Chinese - English      -0.07867 0.0805 30.0 -0.977  0.3365 
##  bottom        .        Chinese - English      -0.24349 0.0805 30.0 -3.023  0.0051 
##  .             Chinese  intact - misconfigured  0.00201 0.0524 75.2  0.038  0.9695 
##  .             Chinese  intact - top           -0.06177 0.0524 75.2 -1.179  0.2423 
##  .             Chinese  intact - bottom        -0.02675 0.0524 75.2 -0.511  0.6112 
##  .             Chinese  misconfigured - top    -0.06378 0.0524 75.2 -1.217  0.2274 
##  .             Chinese  misconfigured - bottom -0.02877 0.0524 75.2 -0.549  0.5847 
##  .             Chinese  top - bottom            0.03501 0.0524 75.2  0.668  0.5061 
##  .             English  intact - misconfigured  0.04150 0.0524 75.2  0.792  0.4309 
##  .             English  intact - top            0.14752 0.0524 75.2  2.815  0.0062 
##  .             English  intact - bottom         0.01771 0.0524 75.2  0.338  0.7363 
##  .             English  misconfigured - top     0.10603 0.0524 75.2  2.023  0.0466 
##  .             English  misconfigured - bottom -0.02378 0.0524 75.2 -0.454  0.6513 
##  .             English  top - bottom           -0.12981 0.0524 75.2 -2.477  0.0155
6.2.3.1.1.2 Right FFA2
anova_E2_rFFA2 <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_FFA2, Label == label_rFFA2_E2))

anova_E2_rFFA2
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE    F  ges p.value
## 1        FaceWord       1, 18 0.04 0.27 .002     .61
## 2          Layout 2.91, 52.37 0.01 0.70 .005     .55
## 3 FaceWord:Layout 2.40, 43.27 0.02 0.56 .005     .60
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_rFFA2 <- emmeans(anova_E2_rFFA2, ~ FaceWord * Layout)

emm_anova_E2_rFFA2 %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_rFFA2, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English   0.0177 0.0344 18 0.516   0.6123 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_rFFA2, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured  0.03019 0.0267 54  1.130  0.6730 
##  intact - top           -0.00560 0.0267 54 -0.210  0.9967 
##  intact - bottom         0.00504 0.0267 54  0.189  0.9976 
##  misconfigured - top    -0.03579 0.0267 54 -1.339  0.5425 
##  misconfigured - bottom -0.02515 0.0267 54 -0.941  0.7830 
##  top - bottom            0.01064 0.0267 54  0.398  0.9784 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_rFFA2 <- contrast(emm_anova_E2_rFFA2, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_rFFA2
##  Layout        FaceWord contrast               estimate     SE    df t.ratio p.value
##  intact        .        Chinese - English      -0.01588 0.0500  56.8 -0.318  0.7517 
##  misconfigured .        Chinese - English       0.02486 0.0500  56.8  0.498  0.6206 
##  top           .        Chinese - English       0.05773 0.0500  56.8  1.156  0.2527 
##  bottom        .        Chinese - English       0.00425 0.0500  56.8  0.085  0.9325 
##  .             Chinese  intact - misconfigured  0.00982 0.0399 106.9  0.246  0.8060 
##  .             Chinese  intact - top           -0.04241 0.0399 106.9 -1.064  0.2899 
##  .             Chinese  intact - bottom        -0.00502 0.0399 106.9 -0.126  0.9000 
##  .             Chinese  misconfigured - top    -0.05223 0.0399 106.9 -1.310  0.1931 
##  .             Chinese  misconfigured - bottom -0.01484 0.0399 106.9 -0.372  0.7105 
##  .             Chinese  top - bottom            0.03738 0.0399 106.9  0.938  0.3505 
##  .             English  intact - misconfigured  0.05056 0.0399 106.9  1.268  0.2075 
##  .             English  intact - top            0.03121 0.0399 106.9  0.783  0.4355 
##  .             English  intact - bottom         0.01511 0.0399 106.9  0.379  0.7055 
##  .             English  misconfigured - top    -0.01936 0.0399 106.9 -0.485  0.6284 
##  .             English  misconfigured - bottom -0.03546 0.0399 106.9 -0.889  0.3759 
##  .             English  top - bottom           -0.01610 0.0399 106.9 -0.404  0.6872
6.2.3.1.2 Plot
sig_uni_E2_FFA2 <- c(signif(as.data.frame(contr_anova_E2_lFFA2)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E2_rFFA2)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E2_FFA2 <- sig_colors(sig_uni_E2_FFA2)

# add the column of Hemisphere
nRow_E2 <-nrow(as.data.frame(emm_anova_E2_lFFA2))
Hemisphere <- c(rep("left", nRow_E2), rep("right", nRow_E2))
desp_uni_E2_FFA2 <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E2_lFFA2), as.data.frame(emm_anova_E2_rFFA2)))

plot_uni_E2_FFA2 <- {
  ggplot(data = desp_uni_E2_FFA2, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(-0.1, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in FFA2 (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = sig_uni_E2_FFA2, color = color_uni_E2_FFA2, size = sig_size, nudge_y = 0.3, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E2_FFA2.png', plot_uni_E2_FFA2, width = 8, height = 5.5)

plot_uni_E2_FFA2

The above figure shows the neural respones (beta values) in FFA2 for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

6.2.3.2 Multivarate analyses (MVPA)

6.2.3.2.1 One-sample t-test
# one-sample for results of mvpa E2 FFA2
one_mvpa_agg_E2_FFA2 <- {
  df_mvpa_acc_E2_FFA2 %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E2_FFA2
6.2.3.2.2 Plot
plot_mvpa_E2_FFA2 <- {
  ggplot(data = one_mvpa_agg_E2_FFA2, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding Accuracy in FFA2", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = signif(one_mvpa_agg_E2_FFA2$p), color = sig_colors(one_mvpa_agg_E2_FFA2$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E2_FFA2.png', plot_mvpa_E2_FFA2, width = 12, height = 5)

plot_mvpa_E2_FFA2

The above figure shows the decoding accuracy in FFA2 for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.3.3 Similarity of top + bottom to intact vs. misconfigured

6.2.3.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in FFA2
one_simi_E2_FFA2 <- {
  df_simi_rate_E2_FFA2 %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E2_FFA2
6.2.3.3.2 Plot
plot_simi_E2_FFA2 <- {
  ggplot(data = one_simi_E2_FFA2, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in FFA2", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E2_FFA2$p, 4), color = sig_colors(one_simi_E2_FFA2$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E2_FFA2.png', plot_simi_E2_FFA2, width = 14, height = 5)

plot_simi_E2_FFA2

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in FFA2. Patterns of top and bottom were combined with different weights, i.e., “Chinese_top0.25-Chinese_bottom0.75” denotes the linear combinations of Chinese_top and Chinese_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.4 Label: left Visual Word Form Area (VWFA)

# label_VWFA_E2 <- label_lVWFA[1] # "roi.lh.f13.w-vs-o.label"

The label used for (left) VWFA in Experiment 1 is roi.lh.f13.w-vs-o.label.

# only keep data for these two labels
df_univar_agg_E2_VWFA <- filter(df_univar_agg_E2, Label %in% label_VWFA_E2)
df_mvpa_acc_E2_VWFA <- filter(df_mvpa_acc_E2, Label %in% label_VWFA_E2)
df_simi_rate_E2_VWFA <- filter(df_rate_simi_E2, Label %in% label_VWFA_E2)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E2_VWFA %>% filter(Label == label_VWFA_E2))$SubjCode))

df_univar_agg_E2_VWFA %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

6.2.4.1 Univariate analyses

6.2.4.1.1 rm-ANOVA
anova_E2_VWFA <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_VWFA, Label == label_VWFA_E2))

anova_E2_VWFA
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F  ges p.value
## 1        FaceWord       1, 10 0.32 41.53 ***  .36  <.0001
## 2          Layout 2.04, 20.37 0.03    3.51 * .009     .05
## 3 FaceWord:Layout 1.99, 19.86 0.05    5.26 *  .02     .01
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_VWFA <- emmeans(anova_E2_VWFA, ~ FaceWord * Layout)

emm_anova_E2_VWFA %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_VWFA, ~ FaceWord), "pairwise")
##  contrast          estimate    SE df t.ratio p.value
##  Chinese - English   -0.779 0.121 10 -6.444  0.0001 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_VWFA, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured -0.10704 0.0426 30 -2.514  0.0779 
##  intact - top            0.00528 0.0426 30  0.124  0.9993 
##  intact - bottom        -0.07858 0.0426 30 -1.846  0.2725 
##  misconfigured - top     0.11231 0.0426 30  2.638  0.0597 
##  misconfigured - bottom  0.02846 0.0426 30  0.668  0.9081 
##  top - bottom           -0.08386 0.0426 30 -1.970  0.2218 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_VWFA <- contrast(emm_anova_E2_VWFA, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_VWFA
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English      -0.81413 0.1386 16.8 -5.873  <.0001 
##  misconfigured .        Chinese - English      -0.87166 0.1386 16.8 -6.288  <.0001 
##  top           .        Chinese - English      -0.51619 0.1386 16.8 -3.724  0.0017 
##  bottom        .        Chinese - English      -0.91351 0.1386 16.8 -6.590  <.0001 
##  .             Chinese  intact - misconfigured -0.07827 0.0699 56.3 -1.120  0.2674 
##  .             Chinese  intact - top           -0.14369 0.0699 56.3 -2.056  0.0444 
##  .             Chinese  intact - bottom        -0.02889 0.0699 56.3 -0.413  0.6809 
##  .             Chinese  misconfigured - top    -0.06542 0.0699 56.3 -0.936  0.3532 
##  .             Chinese  misconfigured - bottom  0.04938 0.0699 56.3  0.707  0.4827 
##  .             Chinese  top - bottom            0.11480 0.0699 56.3  1.643  0.1060 
##  .             English  intact - misconfigured -0.13580 0.0699 56.3 -1.943  0.0570 
##  .             English  intact - top            0.15425 0.0699 56.3  2.207  0.0314 
##  .             English  intact - bottom        -0.12827 0.0699 56.3 -1.835  0.0717 
##  .             English  misconfigured - top     0.29005 0.0699 56.3  4.150  0.0001 
##  .             English  misconfigured - bottom  0.00753 0.0699 56.3  0.108  0.9146 
##  .             English  top - bottom           -0.28252 0.0699 56.3 -4.043  0.0002
6.2.4.1.2 Plot
sig_uni_E2_VWFA <- c(signif(as.data.frame(contr_anova_E2_VWFA)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E2_VWFA <- sig_colors(sig_uni_E2_VWFA)

plot_uni_E2_VWFA <- {
  ggplot(data = as.data.frame(emm_anova_E2_VWFA), aes(y = emmean, x = FaceWord, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(-0.3, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in VWFA (Univariate)", x = "Stimuli", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = sig_uni_E2_VWFA, color = color_uni_E2_VWFA, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E2_VWFA.png', plot_uni_E2_VWFA, width = 8, height = 4)

plot_uni_E2_VWFA

The above figure shows the neural respones (beta values) in VWFA for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

6.2.4.2 Multivarate analyses (MVPA)

6.2.4.2.1 One-sample t-test
# one-sample for results of mvpa E2 VWFA
one_mvpa_agg_E2_VWFA <- {
  df_mvpa_acc_E2_VWFA %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E2_VWFA
6.2.4.2.2 Plot
plot_mvpa_E2_VWFA <- {
  ggplot(data = one_mvpa_agg_E2_VWFA, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(Hemisphere ~ .) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding Accuracy in VWFA", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = signif(one_mvpa_agg_E2_VWFA$p, 4), color = sig_colors(one_mvpa_agg_E2_VWFA$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E2_VWFA.png', plot_mvpa_E2_VWFA, width = 9, height = 5)

plot_mvpa_E2_VWFA

The above figure shows the decoding accuracy in VWFA for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.4.3 Similarity of top + bottom to intact vs. misconfigured

6.2.4.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in VWFA
one_simi_E2_VWFA <- {
  df_simi_rate_E2_VWFA %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E2_VWFA
6.2.4.3.2 Plot
plot_simi_E2_VWFA <- {
  ggplot(data = one_simi_E2_VWFA, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in VWFA", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E2_VWFA$p, 4), color = sig_colors(one_simi_E2_VWFA$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E2_VWFA.png', plot_simi_E2_VWFA, width = 10, height = 5)

plot_simi_E2_VWFA

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in VWFA. Patterns of top and bottom were combined with different weights, i.e., “Chinese_top0.25-Chinese_bottom0.75” denotes the linear combinations of Chinese_top and Chinese_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.5 Label:Lateral Occipital Cortex

# label_lLOC_E2 <- label_lLOC[1] # 
# label_rLOC_E2 <- label_rLOC[1] # 

label_LOC_E2 <- c(label_lLOC_E2, label_rLOC_E2)

The label used for left LOC in Experiment 1 is roi.lh.f13.o-vs-scr.label.
The label used for right LOC in Experiment 1 is roi.rh.f13.o-vs-scr.label.

# only keep data for these two labels
df_univar_agg_E2_LOC <- filter(df_univar_agg_E2, Label %in% label_LOC_E2)
df_mvpa_acc_E2_LOC <- filter(df_mvpa_acc_E2, Label %in% label_LOC_E2)
df_simi_rate_E2_LOC <- filter(df_rate_simi_E2, Label %in% label_LOC_E2)

# subjects used for each hemisphere
# unique(as.character((df_univar_agg_E2_LOC %>% filter(Label == label_lLOC_E2))$SubjCode))

df_univar_agg_E2_LOC %>% 
  select(ExpCode, Hemisphere, Label, SubjCode) %>% 
  distinct() %>% 
  group_by(ExpCode, Hemisphere, Label) %>% 
  summarize(Count = n()) 

6.2.5.1 Univariate analyses

6.2.5.1.1 rm-ANOVA
6.2.5.1.1.1 Left LOC
anova_E2_lLOC <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_LOC, Label == label_lLOC_E2))

anova_E2_lLOC
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE      F  ges p.value
## 1        FaceWord       1, 16 0.09 6.25 *  .01     .02
## 2          Layout 2.36, 37.70 0.04   0.95 .003     .41
## 3 FaceWord:Layout 1.92, 30.75 0.06 3.25 +  .01     .05
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_lLOC <- emmeans(anova_E2_lLOC, ~ FaceWord * Layout)

emm_anova_E2_lLOC %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_lLOC, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English    0.127 0.0507 16 2.501   0.0236 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_lLOC, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured  -0.0567 0.0454 48 -1.250  0.5985 
##  intact - top            -0.0729 0.0454 48 -1.607  0.3844 
##  intact - bottom         -0.0388 0.0454 48 -0.856  0.8272 
##  misconfigured - top     -0.0162 0.0454 48 -0.357  0.9842 
##  misconfigured - bottom   0.0179 0.0454 48  0.394  0.9790 
##  top - bottom             0.0341 0.0454 48  0.751  0.8758 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_lLOC <- contrast(emm_anova_E2_lLOC, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_lLOC
##  Layout        FaceWord contrast               estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English       0.10143 0.0785 55.8  1.292  0.2018 
##  misconfigured .        Chinese - English      -0.01890 0.0785 55.8 -0.241  0.8107 
##  top           .        Chinese - English       0.28412 0.0785 55.8  3.618  0.0006 
##  bottom        .        Chinese - English       0.14014 0.0785 55.8  1.784  0.0798 
##  .             Chinese  intact - misconfigured  0.00346 0.0668 95.4  0.052  0.9588 
##  .             Chinese  intact - top           -0.16423 0.0668 95.4 -2.460  0.0157 
##  .             Chinese  intact - bottom        -0.05818 0.0668 95.4 -0.871  0.3857 
##  .             Chinese  misconfigured - top    -0.16769 0.0668 95.4 -2.512  0.0137 
##  .             Chinese  misconfigured - bottom -0.06164 0.0668 95.4 -0.923  0.3582 
##  .             Chinese  top - bottom            0.10605 0.0668 95.4  1.588  0.1155 
##  .             English  intact - misconfigured -0.11687 0.0668 95.4 -1.751  0.0832 
##  .             English  intact - top            0.01845 0.0668 95.4  0.276  0.7828 
##  .             English  intact - bottom        -0.01947 0.0668 95.4 -0.292  0.7712 
##  .             English  misconfigured - top     0.13533 0.0668 95.4  2.027  0.0455 
##  .             English  misconfigured - bottom  0.09740 0.0668 95.4  1.459  0.1479 
##  .             English  top - bottom           -0.03792 0.0668 95.4 -0.568  0.5714
6.2.5.1.1.2 Right LOC
anova_E2_rLOC <- aov_4(meanResp ~ FaceWord * Layout + (1 + FaceWord * Layout | SubjCode), 
                      data = filter(df_univar_agg_E2_LOC, Label == label_rLOC_E2))

anova_E2_rLOC
## Anova Table (Type 3 tests)
## 
## Response: meanResp
##            Effect          df  MSE         F  ges p.value
## 1        FaceWord       1, 16 0.08 37.94 ***  .04  <.0001
## 2          Layout 2.50, 40.01 0.06    3.13 * .007     .04
## 3 FaceWord:Layout 2.20, 35.20 0.04      1.39 .002     .26
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
## 
## Sphericity correction method: GG
emm_anova_E2_rLOC <- emmeans(anova_E2_rLOC, ~ FaceWord * Layout)

emm_anova_E2_rLOC %>% 
  as.data.frame() %>% 
  arrange(FaceWord)


Posthoc analysis for the main effects:

contrast(emmeans(emm_anova_E2_rLOC, ~ FaceWord), "pairwise")
##  contrast          estimate     SE df t.ratio p.value
##  Chinese - English    0.307 0.0498 16 6.160   <.0001 
## 
## Results are averaged over the levels of: Layout
contrast(emmeans(emm_anova_E2_rLOC, ~ Layout), "pairwise") # , adjust = "none"
##  contrast               estimate     SE df t.ratio p.value
##  intact - misconfigured   0.0851 0.0551 48  1.546  0.4188 
##  intact - top            -0.0824 0.0551 48 -1.497  0.4470 
##  intact - bottom          0.0168 0.0551 48  0.306  0.9900 
##  misconfigured - top     -0.1675 0.0551 48 -3.043  0.0192 
##  misconfigured - bottom  -0.0683 0.0551 48 -1.240  0.6048 
##  top - bottom             0.0993 0.0551 48  1.803  0.2845 
## 
## Results are averaged over the levels of: FaceWord 
## P value adjustment: tukey method for comparing a family of 4 estimates


Results of simple effect analysis (uncorrected):

contr_anova_E2_rLOC <- contrast(emm_anova_E2_rLOC, "pairwise", simple = "each", combine = TRUE, adjust = "none")
# contrast(emm_uni_anova_E2, interaction = "pairwise") # , adjust = "none"
contr_anova_E2_rLOC
##  Layout        FaceWord contrast                estimate     SE   df t.ratio p.value
##  intact        .        Chinese - English       0.202216 0.0729 51.2  2.776  0.0077 
##  misconfigured .        Chinese - English       0.317788 0.0729 51.2  4.362  0.0001 
##  top           .        Chinese - English       0.367403 0.0729 51.2  5.043  <.0001 
##  bottom        .        Chinese - English       0.339270 0.0729 51.2  4.657  <.0001 
##  .             Chinese  intact - misconfigured  0.027318 0.0701 91.1  0.390  0.6978 
##  .             Chinese  intact - top           -0.165025 0.0701 91.1 -2.353  0.0208 
##  .             Chinese  intact - bottom        -0.051700 0.0701 91.1 -0.737  0.4628 
##  .             Chinese  misconfigured - top    -0.192344 0.0701 91.1 -2.743  0.0073 
##  .             Chinese  misconfigured - bottom -0.079018 0.0701 91.1 -1.127  0.2628 
##  .             Chinese  top - bottom            0.113326 0.0701 91.1  1.616  0.1095 
##  .             English  intact - misconfigured  0.142891 0.0701 91.1  2.038  0.0445 
##  .             English  intact - top            0.000162 0.0701 91.1  0.002  0.9982 
##  .             English  intact - bottom         0.085355 0.0701 91.1  1.217  0.2267 
##  .             English  misconfigured - top    -0.142729 0.0701 91.1 -2.035  0.0447 
##  .             English  misconfigured - bottom -0.057536 0.0701 91.1 -0.821  0.4141 
##  .             English  top - bottom            0.085193 0.0701 91.1  1.215  0.2275
6.2.5.1.2 Plot
sig_uni_E2_LOC <- c(signif(as.data.frame(contr_anova_E2_lLOC)[c(5, 11), "p.value"], nDigitals), rep("", 6),
                     signif(as.data.frame(contr_anova_E2_rLOC)[c(5, 11), "p.value"], nDigitals), rep("", 6))
color_uni_E2_LOC <- sig_colors(sig_uni_E2_LOC)

# add the column of Hemisphere
nRow_E2 <-nrow(as.data.frame(emm_anova_E2_lLOC))
Hemisphere <- c(rep("left", nRow_E2), rep("right", nRow_E2))
desp_uni_E2_LOC <- cbind(Hemisphere, rbind(as.data.frame(emm_anova_E2_lLOC), as.data.frame(emm_anova_E2_rLOC)))

plot_uni_E2_LOC <- {
  ggplot(data = desp_uni_E2_LOC, aes(y = emmean, x = Hemisphere, fill = Layout)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(FaceWord ~ .) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_y_continuous(expand= c(0, 0), limits = c(0, activationUL), breaks = seq(0, 3, .5)) +  # remove the space between columns and x axis
    labs(title = "Mean neural responses in LOC (Univariate)", x = "Hemisphere", y = "Beta values") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = sig_uni_E2_LOC, color = color_uni_E2_LOC, size = 5, nudge_y = 0.5, nudge_x = -0.25) + # add starts to the significant columns
    general_theme
}

# ggsave('plot_uni_E2_LOC.png', plot_uni_E2_LOC, width = 8, height = 5.5)

plot_uni_E2_LOC

The above figure shows the neural respones (beta values) in LOC for each condition. The numbers are the p-values for the tests of differences between intact vs. misconfigued in that condition. Error bars represent 95% confidence intervals.

6.2.5.2 Multivarate analyses (MVPA)

6.2.5.2.1 One-sample t-test
# one-sample for results of mvpa E2 LOC
one_mvpa_agg_E2_LOC <- {
  df_mvpa_acc_E2_LOC %>% 
    group_by(Hemisphere, ClassifyPair) %>% 
    summarize(mean = t.test(Accuracy, mu = 0.5, alternative = "greater")[[5]],
               SD = t.test(Accuracy, mu = 0.5, alternative = "greater")[[7]],
               t = t.test(Accuracy, mu = 0.5, alternative = "greater")[[1]],
               df = t.test(Accuracy, mu = 0.5, alternative = "greater")[[2]],
               p = round(t.test(Accuracy, mu = 0.5, alternative = "greater")[[3]], 5),
               lower.CL = t.test(Accuracy, mu = 0.5, alternative = "greater")[[4]][1],
               upper.CL = mean * 2 - lower.CL, # t.test(Accuracy, mu = 0.5, alternative = "two.sided")[[4]][2],
               nullValue = t.test(Accuracy, mu = 0.5, alternative = "greater")[[6]],
               alternative = t.test(Accuracy, mu = 0.5, alternative = "greater")[[8]]
    )
}

one_mvpa_agg_E2_LOC
6.2.5.2.2 Plot
plot_mvpa_E2_LOC <- {
  ggplot(data = one_mvpa_agg_E2_LOC, aes(y = mean, x = ClassifyPair, fill = ClassifyPair)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    scale_fill_manual(values = mvpaColors) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Decoding Accuracy in LOC", x = "Classification Pairs", y = "Accuracy") +  # set the names for main, x and y axises Subjective Responses for E205
    geom_text(label = signif(one_mvpa_agg_E2_LOC$p, 4), color = sig_colors(one_mvpa_agg_E2_LOC$p), size = sig_size, nudge_y = 0.15) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 3))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_mvpa_E2_LOC.png', plot_mvpa_E2_LOC, width = 12, height = 5)

plot_mvpa_E2_LOC

The above figure shows the decoding accuracy in LOC for each pair. The numbers are the p-values for the one-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

6.2.5.3 Similarity of top + bottom to intact vs. misconfigured

6.2.5.3.1 One-sample t-test
# Similarity of top + bottom to intact vs. misconfigured in LOC
one_simi_E2_LOC <- {
  df_simi_rate_E2_LOC %>% 
    group_by(Hemisphere, Combination) %>% 
    summarize(mean = t.test(RateAsMiscon, mu = 0.5)[[5]],
              SD = t.test(RateAsMiscon, mu = 0.5)[[7]],
              t = t.test(RateAsMiscon, mu = 0.5)[[1]],
              df = t.test(RateAsMiscon, mu = 0.5)[[2]],
              p = round(t.test(RateAsMiscon, mu = 0.5)[[3]], 5),
              lower.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][1],
              upper.CL = t.test(RateAsMiscon, mu = 0.5)[[4]][2],
              nullValue = t.test(RateAsMiscon, mu = 0.5)[[6]],
              alternative = t.test(RateAsMiscon, mu = 0.5)[[8]]
    )
}

one_simi_E2_LOC
6.2.5.3.2 Plot
plot_simi_E2_LOC <- {
  ggplot(data = one_simi_E2_LOC, aes(y = mean, x = Combination, fill = Combination)) + # set the data, varialbes for x and y axises
    geom_col(position = "dodge", color = "black", alpha = .7) +  # position of columns and countour of columns
    facet_grid(. ~ Hemisphere) +
    geom_errorbar(mapping = aes(ymin = lower.CL, ymax = upper.CL), linetype = 1,  # set the error bar
                  show.legend = FALSE, width = 0.25, alpha = .5,
                  position = position_dodge(width=0.9)) +
    scale_fill_manual(values = simiColors) +
    geom_hline(yintercept = c(0.5, 1), linetype = 5, alpha = 0.5) +  # add the line for 0.5 and 1 (y)
    scale_y_continuous(expand= c(0, 0), limits = c(0, 1.1), breaks = seq(0, 1, .25)) +  # remove the space between columns and x axis
    # scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) + # show x labels in two rows
    labs(title = "Similarity of top+bottom to intact vs. misconfigured in LOC", x = "Combinations", y = "Rate of Decoding as Misconfigured") +  # set the names for main, x and y axises
    geom_text(label = signif(one_simi_E2_LOC$p, 4), color = sig_colors(one_simi_E2_LOC$p), size = sig_size, nudge_y = 0.25) + # add starts to the significant columns
    general_theme +
    theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.line = element_line(size = 4))
    # theme(axis.text.x = element_text(angle = 90, vjust=.5, hjust = 1), # 
    #       axis.line = element_line(size = 3)) 
}

# ggsave('plot_simi_E2_LOC.png', plot_simi_E2_LOC, width = 14, height = 5)

plot_simi_E2_LOC

The above figure shows the probability of top+bottom being decoded as misconfigued conditions in LOC. Patterns of top and bottom were combined with different weights, i.e., “Chinese_top0.25-Chinese_bottom0.75” denotes the linear combinations of Chinese_top and Chinese_bottom with the weights of 0.25/0.75. The numbers are the p-values for the two-tail one-sample t-tests against the chance level (0.5) in that condition. Error bars represent 95% confidence intervals.

7 Versions of packages used

# rstudioapi::versionInfo()
sessionInfo()
## R version 3.6.1 (2019-07-05)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Mojave 10.14.5
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] emmeans_1.4.2   lmerTest_3.1-0  afex_0.25-1     lme4_1.1-21     Matrix_1.2-17   forcats_0.4.0   stringr_1.4.0   dplyr_0.8.5     purrr_0.3.3     readr_1.3.1     tidyr_1.0.2     tibble_2.1.3    ggplot2_3.2.1   tidyverse_1.2.1
## 
## loaded via a namespace (and not attached):
##  [1] httr_1.4.1          jsonlite_1.6.1      splines_3.6.1       carData_3.0-3       modelr_0.1.5        assertthat_0.2.1    cellranger_1.1.0    yaml_2.2.1          numDeriv_2016.8-1.1 pillar_1.4.3        backports_1.1.5     lattice_0.20-38     glue_1.3.2          digest_0.6.25       rvest_0.3.5         minqa_1.2.4         colorspace_1.4-1    htmltools_0.4.0     plyr_1.8.6          pkgconfig_2.0.3     broom_0.5.3.9000    haven_2.2.0        
## [23] xtable_1.8-4        mvtnorm_1.0-11      scales_1.0.0        openxlsx_4.1.3      rio_0.5.16          generics_0.0.2      car_3.0-5           ellipsis_0.3.0      withr_2.1.2         lazyeval_0.2.2      cli_2.0.2           magrittr_1.5        crayon_1.3.4        readxl_1.3.1        estimability_1.3    evaluate_0.14       fansi_0.4.1         nlme_3.1-140        MASS_7.3-51.4       xml2_1.2.2          foreign_0.8-71      tools_3.6.1        
## [45] data.table_1.12.6   hms_0.5.2           lifecycle_0.2.0     munsell_0.5.0       zip_2.0.4           compiler_3.6.1      rlang_0.4.5         grid_3.6.1          nloptr_1.2.1        rstudioapi_0.10     rmarkdown_2.1       boot_1.3-22         gtable_0.3.0        abind_1.4-5         curl_4.2            reshape2_1.4.3      R6_2.4.1            lubridate_1.7.4     knitr_1.28          stringi_1.4.6       parallel_3.6.1      Rcpp_1.0.4         
## [67] vctrs_0.2.4         coda_0.19-3         tidyselect_1.0.0    xfun_0.12
 

A work by Haiyang Jin